₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,099 members, 8,420,334 topics. Date: Thursday, 04 June 2026 at 04:44 PM

Toggle theme

How Do I Read Integer Values From Oledb In C# - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHow Do I Read Integer Values From Oledb In C# (1411 Views)

1 Reply (Go Down)

How Do I Read Integer Values From Oledb In C# by darealez(op): 7:17am On Dec 10, 2015
Using access database(Oledb) in C#, I've being able to read string values from the database using the
While(Reader.read)
{
String name = reader.getstring(0);
}
but it ain't working for integer values "ID" .
I tried using reader.getint16(0) all to no avail.
Re: How Do I Read Integer Values From Oledb In C# by Nobody: 7:04pm On Dec 10, 2015
okay this I how to access Ms access db


using System;
using System.Data;
using System.Data.OleDb;
public class Connect {
public static void Main () {
String connect = "Provider=Microsoft.JET.OLEDB.4.0;data source=.\\Students .mdb" ;
OleDbConnection con = new OleDbConnection(connect);
con.Open();
Console.WriteLine( "List of male students database" );
con.Close();
}
}





The file blah.md you should copy it from your acess database . and give a the specific data you want .
Re: How Do I Read Integer Values From Oledb In C# by Nobody: 7:14pm On Dec 10, 2015
Re: How Do I Read Integer Values From Oledb In C# by darealez(op): 9:57pm On Dec 10, 2015
Finally got it
Int32 da=reader.GetInt32(0);
worked!

Tnks(@all)
Re: How Do I Read Integer Values From Oledb In C# by prof30(m): 6:30pm On Dec 11, 2015
Using access database(Oledb) in C#, I've being able to read string values from the database using the
While(Reader.read)
{
String name = reader.getstring(0);
}
but it ain't working for integer values "ID" .
I tried using reader.getint16(0) all to no avail.

try
while(reader.read()){

String number = reader.getint32(1).tostring();
textbox1.text = number;
}

if it did not work then change the string data type to int..... that is

int number =.......
1 Reply

Integer Types Should Inherit From ...Integer: ICT Training And JobCreating UWP Application In C# Or C++ (xaml)234

Photos And Video Of A Flying Car Exclusive ReleasedQuantum ComputingSoftware Development