Peter said:
Hi!
I am frustrated! I spent a lot of time designing a custom dataset schema
(XSD file) using the Dataset designer. In my main form I had created an
instance of a typed dataset using that schema, and all was going well for
days. Now, tonight, I suddenly opened up the solution and 1) the dataset
is gone from the main form, and 2) I can't re-instantiate it. When I drag
a new dataset onto the control surface, my XSD file is no longer listed...
I just see (no datasets in project).
I've tried copying the contents of that file into a new dataset, with no
luck. Why would VB suddenly go berserk on me like this? And how can I
comvince it that, yes, there IS a dataset schema all ready to use?
Update on the problem: there is something wrong with the XSD file preventing
it from being turned into a dataset. It's giving me the error:
Invalid XPath selection inside field node. Cannot find: ID.
Is there any way to tell what line this is happening at? I am not very good
at reading these files (and I can't figure out why there is suddenly an
error... .NET generated this for me!). Most of this file (including the
table relations) worked not 24 hours ago.
In case it would help if I posted the entire XSD file, here it is:
***
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Papers" xmlns="" xmlns:xs="
http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Papers" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Paper" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1"
msdata:AutoIncrement="true" msdata:AutoIncrementSeed="0"
msdata:AutoIncrementStep="1" maxOccurs="1" />
<xs:element name="Size" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="Weight" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="Brand" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="PagesPerSet" type="xs:int" minOccurs="1"
maxOccurs="1" />
<xs:element name="Type" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="Color" type="xs:int" minOccurs="1"
maxOccurs="unbounded" default="0" />
<xs:element name="Finish" type="xs:int" minOccurs="1" maxOccurs="1"
default="0" />
<xs:element name="WholesalePrice" type="xs:double" minOccurs="1"
maxOccurs="1" default="0" />
<xs:element name="IsFree" type="xs:boolean" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Size">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" maxOccurs="1" minOccurs="1"
msdata:AutoIncrement="true" msdata:AutoIncrementSeed="0"
msdata:AutoIncrementStep="1" />
<xs:element name="XInches" type="xs:double" maxOccurs="1"
minOccurs="1" />
<xs:element name="YInches" type="xs:double" minOccurs="1"
maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Color">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" maxOccurs="1" minOccurs="1"
msdata:AutoIncrementSeed="0" msdata:AutoIncrementStep="1"
msdata:AutoIncrement="true" />
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"
/>
<xs:element name="Hex" type="xColor" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Weight">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1" maxOccurs="1"
msdata:AutoIncrementSeed="0" msdata:AutoIncrementStep="1"
msdata:AutoIncrement="true" />
<xs:element name="Pounds" type="xs:int" minOccurs="1" maxOccurs="1"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Brand">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1" maxOccurs="1" />
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Type">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1" maxOccurs="1" />
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Finish">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:int" minOccurs="1" maxOccurs="1" />
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:key name="PaperKey" msdata
rimaryKey="true">
<xs:selector xpath=".//Paper" />
<xs:field xpath="ID" />
</xs:key>
<xs:key name="SizeKey" msdata
rimaryKey="true">
<xs:selector xpath=".//Size" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="PaperSize" refer="SizeKey"
msdata:AcceptRejectRule="Cascade" msdata
eleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Size" />
</xs:keyref>
<xs:key name="ColorKey" msdata
rimaryKey="true">
<xs:selector xpath=".//Color" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="PaperColor" refer="ColorKey"
msdata:AcceptRejectRule="Cascade" msdata:UpdateRule="Cascade"
msdata
eleteRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Color" />
</xs:keyref>
<xs:key name="WeightKey" msdata
rimaryKey="true">
<xs:selector xpath=".//Weight" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="WeightPaper" refer="WeightKey"
msdata:AcceptRejectRule="Cascade" msdata
eleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Weight" />
</xs:keyref>
<xs:key name="BrandKey" msdata
rimaryKey="true">
<xs:selector xpath=".//Brand" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="BrandPaper" refer="BrandKey"
msdata:AcceptRejectRule="Cascade" msdata
eleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Brand" />
</xs:keyref>
<xs:key name="TypeKey" msdata
rimaryKey="true">
<xs:selector xpath=".//Type" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="TypePaper" refer="TypeKey"
msdata:AcceptRejectRule="Cascade" msdata
eleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Type" />
</xs:keyref>
<xs:key name="FinishKey" msdata
rimaryKey="true">
<xs:selector xpath=".//Finish" />
<xs:field xpath="ID" />
</xs:key>
<xs:keyref name="FinishPaper" refer="FinishKey"
msdata:AcceptRejectRule="Cascade" msdata
eleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//Paper" />
<xs:field xpath="Finish" />
</xs:keyref>
</xs:element>
<xs:simpleType name="xColor">
<xs:restriction base="xs:string">
<xs:length value="6" />
<xs
attern value="[0-9A-F]{6}" />
</xs:restriction>
</xs:simpleType>
</xs:schema>