Hi (again),
Sorry about all the posts but I am eager to get a handle on this ADO.Net stuff.
I have executed commands and filled a combo box - was now hoping to take selected value and execute a further sql statement.
E.g.
ToolCode = Strings.Mid(cmbTools.Text, 1, 5) 'Returns correct Value
cn = New OleDbConnection(ConnString)
cn.Open()
cmd = New OleDbCommand("SELECT Price, BoughtDate FROM Tools WHERE ToolID = '" & ToolCode & "';")
dr = cmd.ExecuteReader
While dr.Read()
Me.txtPrice.Text = dr(0)
Me.txtBoughtDate.Text = dr(1)
End While
But at the line dr = cmdExecuteReader I get an error:
System.InvalidOperationException in system.data.dll
Why is this happening? Having trouble getting my head round this dataAdapter thing.
Sorry about all the posts but I am eager to get a handle on this ADO.Net stuff.
I have executed commands and filled a combo box - was now hoping to take selected value and execute a further sql statement.
E.g.
ToolCode = Strings.Mid(cmbTools.Text, 1, 5) 'Returns correct Value
cn = New OleDbConnection(ConnString)
cn.Open()
cmd = New OleDbCommand("SELECT Price, BoughtDate FROM Tools WHERE ToolID = '" & ToolCode & "';")
dr = cmd.ExecuteReader
While dr.Read()
Me.txtPrice.Text = dr(0)
Me.txtBoughtDate.Text = dr(1)
End While
But at the line dr = cmdExecuteReader I get an error:
System.InvalidOperationException in system.data.dll
Why is this happening? Having trouble getting my head round this dataAdapter thing.