Re: How do I requiry a dataset? by Francois
Francois
Fri Jul 01 07:58:00 CDT 2005
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
"Paul DeWitt" <PaulDeWitt@discussions.microsoft.com> wrote in message
news:C6F3C59C-2614-41E1-83C8-07FE26D53466@microsoft.com...
> 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.
>
> "Francois Bonin [MVP]" wrote:
>
>> 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
>>
>> "Paul DeWitt" <PaulDeWitt@discussions.microsoft.com> wrote in message
>> news:66CD725D-446A-44AE-A4EF-68C586C76ED6@microsoft.com...
>> >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
>>
>>
>>