Help with dataset and datagrid

sunnyjulka

Member
Joined
Sep 12, 2005
Messages
17
Programming Experience
1-3
Greetings to everyone
I am creating a sales application(sales register) and I am tring to show items from my database Inventory table to the datagrid. I put the "Item ID" in a textbox and that item appears in the datagrid by binding the data to it. My application works for just one item and I don't know how to do it for multiple items. By multiple items I mean I want to put the Item ID in the textbox for different products and all those products show up in the datagrid.

The code that I have right now which works for only one item to show in the datagrid is as follows:

Dim sqlComm As New SqlCommand("Select * from Test2 where id=@p1", sqlConn)
Dim par As New SqlParameter("@p1", SqlDbType.Int)
par.Value = TextBox1.Text
sqlComm.Parameters.Add(par)
Dim DA As New SqlDataAdapter(sqlComm)

Dim DS As New DataSet
DA.Fill(DS, "Test2")
DataGrid1.SetDataBinding(DS, "Test2")

I am new to this so i dont know if we can save the dataset somehow or ?????
Regards to everyone
 
Back
Top