what wrong in this querry ?Code:Public con As OleDbConnection Public cmd As OleDbCommand Public dr As OleDbDataReader con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\student.mdb;") con.Open() str = "select name," & textbox1.text & " from Table1" 'textbox1.text="Address" cmd = New OleDbCommand(str, con) dr = cmd.ExecuteReader() While dr.Read() MsgBox(dr(0)) MsgBox(dr(1)) End While dr.Close()
it give error in dr(1) ..




Reply With Quote