By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,685 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

Two Datasets on a single form

P: n/a
Sorry for the crosspost, I initially posted this to the
microsoft.public.dotnet.languages.vb.data
group, but it never showed up there. (Is that newsgroup still active???)

I have two datasets declared on a single form. The form is instantiated by
another form which passes two parameters to the form. These parameters are
used to select the data for each of the two datasets.

The first dataset loads fine as does the second one. If changes are made to
the controls bound to the first data set the binding context correctly
reports that the dataset has modifications and my code updates the database
with the info from the dataset.

The second dataset however ALWAYS reports that the dataset has ADDITIONS not
modifications. I traced back through the code to find that this actually
occurs IMMEDIATELY after the fill of the dataset from the sql adapter. Odd.
Thinking maybe it had something to do with the combo boxes that this
particular dataset was bound to, I removed all the databinding for this
dataset. Yet the binding context still sets the
HasChanges(DataRowState.Added) flag as true right after the fill. To get
around the issue I do an AcceptChanges right after the fill and
re-established the databindings. Now when I change data in one of the bound
controls, the binding context reports that I have modifications NOT
additions.

Anyone know why a newly filled dataset should immediately set the
HasChanges(DataRowState.Added) flag to true?

Gary Shell

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Gary,

You are sure you do not set this flag before your fill
http://msdn.microsoft.com/library/de...gfilltopic.asp

Just the first what I thought reading your message.

Cor
Nov 21 '05 #2

P: n/a
I am not explicitly setting it. (Didn't even realize it exists!) Does the
VB.NET IDE set this by automatically? Both datasets on the form were
created using the IDE.

Just did a text search and it WAS set to false for this dataset. But for
the life of me I don't know why or how!!!
Me.sqladapterScenarioLoc.AcceptChangesDuringFill = False
Is there some option in the IDE when configuring a SQL adapter that does
this?

Thanks!!!!!!!!!!!!!!

Gary

"Cor Ligthert" <no************@planet.nl> wrote in message
news:u1**************@TK2MSFTNGP14.phx.gbl...
Gary,

You are sure you do not set this flag before your fill
http://msdn.microsoft.com/library/de...gfilltopic.asp
Just the first what I thought reading your message.

Cor

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.