Sign in to follow this  

[.net] Exception with DataSet Constraints

This topic is 4857 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
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

This topic is 4857 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this