DaedalusPrime
Programmer
My application uses a dataset that Visual Studio generated using an XML schema. When I try to load the form that has textboxes bound to the various data elements I get an exception thrown that reads:
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: Cannot add primary key constraint since primary key is already set for the table.
Since my schema contains a large number of elements, I've pasted below a small example I found that follows the same structural format that my schema does:
I'm not sure where the multiple keys are being defined or how to enforce that only one is in such a way that Visual Studio won't complain.
Thanks!
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: Cannot add primary key constraint since primary key is already set for the table.
Since my schema contains a large number of elements, I've pasted below a small example I found that follows the same structural format that my schema does:
Code:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema">[/URL]
<xs:element name="book">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="author" type="xs:string"/>
<xs:element name="character" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="since" type="xs:date"/>
<xs:element name="qualification" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I'm not sure where the multiple keys are being defined or how to enforce that only one is in such a way that Visual Studio won't complain.
Thanks!