vb.net and mysql connectivity [closed]
- by kalpana
I have used adodb using odbc database connectivity for connecting vb.net to mysql. I have fetched table values into recordset. I want to fetch only one column values (for example, table name-login, column name-password and values in password column are "manage","sales","general"). I want to fetch these values in text boxes.
I have written code but it's not working.
Dim conn As New ADODB.Connection
Dim res As New ADODB.Recordset
conn.Open("test", "root", "root")
res = conn.Execute("select password from login")
textbox1.text=res(0).value
textbox2.text=res(1).value
textbox3.text=res(2).value
I am getting data in textbox1 but other data is not getting inserted into textbox2 and textbox3..I am getting error i.e
(1) Item cannot be found in the collection corresponding to the requested name or ordinal.