i will input a number in textbox1 which will be the id column in the database and then when i press the search button it will display the corresponding data based on the id. here's my code
the error is in
Data type mismatch in criteria expression.
i use ms access for the database and visual studio 2010.
thanks in advance for helping ^_^
Code:
strsql = "select * from tbuser where ID = '" & TextBox1.Text & "'"
sqlcmd.CommandText = strsql
sqlcmd.Connection = GetConnection1()
read = sqlcmd.ExecuteReader()
If read.HasRows Then
While read.Read
Label2.Text = (read.GetChar(1))
End While
End If
GetConnection1.Close()
Code:
read = sqlcmd.ExecuteReader()
i use ms access for the database and visual studio 2010.
thanks in advance for helping ^_^
Comment