-
Filtering Records
I am using this code to select the record I want but I encounter an error.
Dim drsql As New OleDb("SELECT * FROM employee WHERE empno like '" TextBox1.Text "'", OleDbConnection1)
'Dim DataSet11 As New DataSet()
DataSet11.Clear()
drsql.Fill(DataSet11, "Employee")
DataGrid1.DataSource = DataSet11
Kindly correct this for me?
-
Your select statment is wrong.
If empno is a text field then it shoud be;
"SELECT * FROM employee WHERE empno like '" & TextBox1.Text & "%'"
And if empno is a numeric field you can not use 'Like' to filter the records.