SqlAdapter and Parameters

L

LS

I have a Windows Form (VS.NET 2003) that uses a SqlAdapter and a dataset
with 2 tables. 1 table is for a combobox and the other for a datagrid.

I want to trigger a dataset refresh on the datagrid table when the combobox
value is changed.

What is the easiest way to update the SqlAdapter parameter and then refresh
the dataset table?

I tried to update the parameter and issue a SqlAdapter.Fill(ds, "table"),
but it did not work.

Thanks,

Larry
 
B

Brian P. Hammer

In the combobox selected index change event:

With daHistory.SelectCommand.Parameters
.Item("@ContactID").Value = ContactID
End With

DsHistory1.Clear()
daHistory.Fill(DsHistory1, "tblHistory")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top