Hi Daniel,
I agree with Kevin. Setting the EnforceConstraints property of a DataSet to
false only means that constraint rules are not followed when attempting any
update operation in the DataSet.
Even if the EnforceConstraints property is set to false, the ColumnChanging
or RowChanging will still be raised when any update operation is made.
If you don't want to raise the RowChanging/ColumnChanging event while
filling the DataTable, I suggest that you unsubscribe these events before
filling the DataTable and then subscribe these events again later.
The following is a sample.
// unsubscribe the RowChanging event
mfldTestTable.RowChanging -= new
DataRowChangeEventHandler(mfldTestTable_RowChanging);
// fill the data table
this.mctlTestTableTableAdapter.Fill(this.mctlTestDataSet.TestTable);
// subscribe the RowChanging event again
mfldTestTable.RowChanging += new
DataRowChangeEventHandler(mfldTestTable_RowChanging);
As for the MSDN document "How to: Turn
Off Constraints While Filling a Dataset"
http://msdn2.microsoft.com/en-us/library/s3bxwk8b(vs.80).aspx , it seems to
be incorrect. I will report this to our product team.
Thank you for pointing it out to us!
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.