How do I requiry a dataset?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with 2 tabs. 1 tab contains a data entry screen and the second
tab contains a datagrid with a listing of the entered data. I fill the
datagrid when I load the form. I want to requiry or refill the datagrid when
the tab is made active. Is there a refill command for the dataset? I have
tried dataset.fill() and dataset.getchanges() and dataadapter.Update.

Thanks
 
Could you be a bit more detailed?
Does the first tab make modifications to the data that is being displayed on
the 2nd tab?
If this is not the case, a simple dataadapter.Fill(dataset) on the 2nd tab
will do the trick.
If you ARE making modifications, then you should write those modifications
before calling dataadapter.Fill(...)
and you do that with dataadapter.Update(...)

HTH,
Cois
 
The first tab contains a list of fields with a toolbar with an add button.
The second tab contains a dataset with read-only data. It is a display of
the previously entered data. I tried the dataadapter.update command but it
did not work. I perform the dataadapter.fill command when the form is
created. If I execute a second fill statement, the datagrid contains double
records.
 
You can Clear the dataset first, or just the table you are using. This will
prevent the double entries.
--
-
Thanks,

Steven Perry
 
From what I gather, you are making modifications on the 1st tab.
Are you making those modifications directly to the database (by using SQL
queries or stored procedures)?
If this is the case, then you will have to:
1. Clear() the DataSet
2. call dataadapter.Fill()

If instead, you are making those modifications to the DataSet object, you
will have to
1. call dataset.AcceptChanges(); you do NOT have to call dataadapter.Fill()
2. write the modifications to the underlying database by calling
dataadapter.Update()

Cois
 
Back
Top