Here is the code but I wonder if it has to do that vb 2008 is without service pack 1, maybe I must update?
sql command in oledbcommand (note that in design time "preview data" the command works)
SELECT id, car_num, owner, afm1, address, phone, owner2, afm2, address2, phone2, owner3, afm3, address3, phone3, comments, photo, plaisio_num,
speciment_of_vechicle, type_of_vechicle, ead, product_facilities, onoma_patros, doy
FROM dbo.Table_1
WHERE (car_num LIKE '%' + ? + '%') OR
(owner LIKE ? + '%') OR
(afm1 LIKE ? + '%') OR
(address LIKE ? + '%') OR
(phone LIKE ? + '%') OR
(owner2 LIKE ? + '%') OR
(owner3 LIKE ? + '%') OR
(plaisio_num LIKE ? + '%') OR
(ead LIKE ? + '%')
and here is the serach button code (combo index of 0,5,7,8 works and gives the results)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Select Case ComboBox1.SelectedIndex
Case 0
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(0).Value = TextBox1.Text
OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
Case 1
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(1).Value=TextBox1.Text OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
Case 2
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(2).Value = TextBox1.Text
OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
Case 3
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(3).Value = TextBox1.Text
OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
Case 4
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(4).Value = TextBox1.Text
OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
Case 5
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(5).Value = TextBox1.Text
OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
Case 6
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(6).Value = TextBox1.Text
OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
Case 7
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(7).Value = TextBox1.Text
OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
Case 8
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.Parameters(8).Value = TextBox1.Text
OleDbDataAdapter1.Fill(DataSet51, "Table_1")
OleDbConnection1.Close()
End Select
End Sub