lindy2003 Posted February 24, 2004 Posted February 24, 2004 I got the error say : "Addition Information: No data exists for row/column" when I loaded data from OledBdatareader to textbox. Here is my code Function GetCustomer() as boolean Dim dr as oledb.oledbDatareader dim mycommand as new Oledb.OledbCommand() dim myConn as new oledb.OledbConnection() dim strSql as string strSql = "Select SerialNumber, LastName, FirstName From Customer" myconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Customer.mdb'" myconn.open mycommand = new oledb.oledbcommand(strsql, myconn) try dr = mycommand.executereader() catch ex as oledb.oledbexception return false end try while dr.read() txtSerialNumber.text = dr("SerialNumber") txtLast.text = dr("LastName") txtFirst.text= dr("FirstName") end while dr.close myconn.close return true End function I debugged and It gave me the error at dr("LastName"). Please help me with this problem. Thanks Quote
Moderators Robby Posted February 24, 2004 Moderators Posted February 24, 2004 Are you trying to bind the textboxes to the data? In your code you are looping the DR, so what happens if there are 100 rows in it, will you display only the last row in your textbox? Quote Visit...Bassic Software
lindy2003 Posted February 24, 2004 Author Posted February 24, 2004 Actually it has only one row Quote
Moderators Robby Posted February 24, 2004 Moderators Posted February 24, 2004 Are there any Null values in the table? Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.