phonl wrote:
I am a vb6 ADO developer looking at vb.net 2005 and ADO2.net.
I used the vb.net 2005 data wizard to bind some controls to a database. Now
I want to run a select query and have the bound controls reflect the change
from the query. How would I do that?
The wizard created a TableAdapter, BindingSource, and DataSet. Somehow I
need to run feed them a select query to update the data.
In the dataset designer, rightclick the tableadapter, choose Add |
Query... and follow through the wizard. When asked to supply the query
text, you can use parameters (eg in a access db, "select blah from
orders where id=?)". This will create a new method on the TableAdapter
called... well, called what you like, but I typically name mine
FillBy<parameter name>, eg FillByOrderDate. This method will take the
parameter as an argument. Then to run the query just do
MyTableAdapter.FillByWhatever(whatever) - this will run the query and
your bound controls will reflect the new resultset.
--
Larry Lard
Replies to group please