Professional Documents
Culture Documents
Dim STR As String
Dim STR As String
\INSTANCE;initial
catalog=example;user=sa;password=gariahat")
ItemDataGridView.DataSource = ds.Tables(0)
MessageBox.Show("match found")
Else
End If
ElseIf ComboBox1.SelectedIndex = 1 Then
Dim searchtext As String = TextBox1.Text
Dim cmd As New SqlCommand("select * from item where name like '%"
& searchtext & "%' order by broker_id", con)
Dim da As New SqlDataAdapter(cmd)
ItemDataGridView.DataSource = ds.Tables(0)
MessageBox.Show("match found")
Else
End If
ElseIf ComboBox1.SelectedIndex = 2 Then
Dim searchtext As String = TextBox1.Text
Dim cmd As New SqlCommand("select * from item where lot_no like
'%" & searchtext & "%'order by broker_id", con)
Dim da As New SqlDataAdapter(cmd)
ItemDataGridView.DataSource = ds.Tables(0)
MessageBox.Show("match found")
Else
End If
ElseIf ComboBox1.SelectedIndex = 3 Then
Dim searchtext As String = TextBox1.Text
Dim cmd As New SqlCommand("select * from item where place like
'%" & searchtext & "%' order by broker_id", con)
Dim da As New SqlDataAdapter(cmd)
ItemDataGridView.DataSource = ds.Tables(0)
MessageBox.Show("match found")
Else
End If
ElseIf ComboBox1.SelectedIndex = 4 Then
Dim searchtext As String = TextBox1.Text
Dim cmd As New SqlCommand("select * from item where year like '%"
& searchtext & "%' order by broker_id", con)
Dim da As New SqlDataAdapter(cmd)
ItemDataGridView.DataSource = ds.Tables(0)
MessageBox.Show("match found")
Else
End If
End If
End Sub