How Do I Read Integer Values From Oledb In C# - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › How Do I Read Integer Values From Oledb In C# (1411 Views)
| 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 |
see this code below it might help www.java2s.com/Code/CSharp/Database-ADO.net/Readdatafromoledbconnection.htm |
| 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 =....... |
Integer Types Should Inherit From ... • Integer: ICT Training And Job • Creating UWP Application In C# Or C++ (xaml) • 2 • 3 • 4
Photos And Video Of A Flying Car Exclusive Released • Quantum Computing • Software Development