Jump to content
  • Advertisement
Sign in to follow this  
Zbyl

[.net] Exception with DataSet Constraints

This topic is 5164 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I get this exception, when calling "((System.ComponentModel.ISupportInitialize)(this.Table)).EndInit()": "An unhandled exception of type 'System.Data.DataException' occurred in system.data.dll Additional information: Constraint matches constraint named Constraint1 already in collection." It hapens only if I add a foreign constraint to the Table. Funny thing is that I don't have a constraint named "Constraint1" anywhere in the dataset. What can this exception mean?

Share this post


Link to post
Share on other sites
Advertisement
After I've restarted Visual Studio EVERY primary key constraint in my dataset was named "Constraint1"!!! Why?!

Can you tell me what is going on?

Share this post


Link to post
Share on other sites
That will happen if you're just copying objects rather then typing them out. In fact, it will happen any time you place an object, but they should be named sequentially. Have you tried renaming the constraints to the proper names?

Share this post


Link to post
Share on other sites
Quote:
That will happen if you're just copying objects rather then typing them out.

I wasn't copying them...
Quote:
Have you tried renaming the constraints to the proper names?

They had proper names...

It looks like VS was generating some constraints at run time, under the same name, but is this probable?

Anyway, thanks for reply.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!