Does enforceconstraints mean errors or relations??

B

bjako

Does the EnforceConstraints option on a dataset just basically turn on
and off errors?

I read the doco thinking it meant I could temporarily turn off the
relations that were added to the dataset but it would appear it has no
affect on enforcing the relations?

The doco states "Gets or sets a value indicating whether constraint
rules are followed when attempting any update operation."

But if I delete a parent record it automatically deletes the children.
Sounds like constraints are being enforced or should I not think of a
relation as a constraint?

Any clarification or pointers to good articles would be much
appreciated to clear this one up.

Thanks,Ben
 
W

William Ryan eMVP

A constraint isn't violated if you delete a parent record and it deletes the
child. There are many constraints available that aren't relations, like
PrimaryKey, AllowNull etc. Turning off constraints disables them but if you
violate one of the rules, you may not be able to reset the constraint again
when you try to enable it unless your data conform.s

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top