Private Sub SetParameters()
Dim Command As New SqlClient.SqlCommand("SalesByCategory")
Dim Tabadapter1 As New SqlClient.SqlDataAdapter
Dim DataSET11 As New DataSet
Dim par1 As New SqlParameter
Dim par2 As New SqlParameter
con = New SqlClient.SqlConnection("server=omron-jane;database=ss1;user=sa;password=970701")
con.Open()
par1.ParameterName = "@a1"
par2.ParameterName = "@a2"
par1.SqlDbType = SqlDbType.Char
par2.SqlDbType = SqlDbType.Char
Command.CommandType = CommandType.Text
Command.Connection = con
Command.CommandText = sql
Command.Parameters.Add(par1)
Command.Parameters.Add(par2)
Command.Parameters.Item(0).Value = TextBox1.Text
Command.Parameters.Item(1).Value = TextBox2.Text
Tabadapter1.SelectCommand = Command
Tabadapter1.Fill(DataSET11)
con.Close()
End Sub