[.net] Exception with DataSet Constraints
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?
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?
Can you tell me what is going on?
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?
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement