Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Normally I have set the property of my datasets
Me.EnforceConstraints = True

It works fine but I have been complained by my clients that after some times (reinstalling windows or so) some forms start to give error that you need to relax the constraints, making it Me.EnforceConstraints = False

I need to know if I set them all to False, what implications my applications might face.

Thanks
Posted

Hypermellow's answer is correct but I think there's one bit missing there:

The constraints in your datasets exist for reason. As Hypermellow pointed out, disabling them will probably just move the error to your database. What that means is, the correct solution would be to check why the constraints are being violated and if your constraints are correctly defined, the answer to that would be that there's a problem with your business code that modifies a dataset. Disabling constraints would mean to ignore the error.
 
Share this answer
 
Comments
hypermellow 19-Mar-15 8:47am    
A well made valid point :) 5*
[no name] 19-Mar-15 9:09am    
Thank you! :)
Hi,

If you set your DataSet's EnforceConstraints property to False, then constraint rules will not be enforced with the DataSet.

If your clients are receiving errors that they are breaking the constraints, then disabling the EnforceConstraints property would possibly just move the error to your database.

Have a look at the documentation of DataSet.EnforceConstraints Property [^]

... hope it helps.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900