Peter's Gekko

Sponsors

The Lounge

Wicked Cool Jobs

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
What am I missing ?

I love typed datasets. I love XSD's. Import them into your project and .NET will generate a beautifull class for you. Usually importing datasets is a no-bump matter but there is something wrong with this schema :

<?xml version="1.0" encoding="utf-8" ?>

<xs:schema id="DataSet1" targetNamespace=http://www.testgekko/pp/DataSet1.xsd
xmlns:mstns
=http://www.testgekko/pp/DataSet1.xsd
xmlns=http://www.testgekko/pp/DataSet1.xsd
xmlns:xs
=http://www.w3.org/2001/XMLSchema
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified"

elementFormDefault="qualified">

<xs:element name="DataSet1" msdata:IsDataSet="true" msdata:Locale="nl-NL">
<xs:complexType
>
<xs:choice maxOccurs
="unbounded">
   <xs:element name
="Categories">
   <xs:complexType
>
   <xs:sequence
>
      <xs:element name="CategoryID" msdata:ReadOnly="true" msdata:AutoIncrement="true" type="xs:int"
/>
      <xs:element name="CategoryName" type="xs:string"
/>
      <xs:element name="Description" type="xs:string" minOccurs="0"
/>
      <xs:element name="Picture" type="xs:base64Binary" minOccurs="0"
/>
   </xs:sequence
>
   </xs:complexType
>
   </xs:element
>
</xs:choice
>
</xs:complexType>

<xs:unique name="Constraint1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Categories"
/>
<xs:field xpath="mstns:CategoryID"
/>
</xs:unique>

</xs:element>

</xs:schema>

XSD parses the schema without complaining. The app builds. But there are no classes generated. So you can't use the dataset. I've been staring over and over again but I just don't understand what's wrong with the schema. Anybody got a clue ?

Peter

Update : the schema is OK, it is VS: http://dotnetjunkies.com/WebLog/petergekko/archive/2004/03/10/8766.aspx


Posted Tue, Mar 9 2004 6:41 PM by pvanooijen

[Advertisement]

Comments

Kirk Marple wrote re: What am I missing ?
on Tue, Mar 9 2004 1:49 PM
have you tried taking out the Picture element and seeing if it generates classes?

i'm wondering if the class generator doesn't know what datatype to generate for base64binary.

just a thought,
Kirk
Peter van Ooijen wrote re: What am I missing ?
on Tue, Mar 9 2004 1:52 PM
tried that allready Thanks.
JosephCooney wrote re: What am I missing ?
on Tue, Mar 9 2004 4:50 PM
Hi Peter

I have a utility I'm writing that can create typed datasets directly from regular 'live' datasets (it infers the schema and then uses the same classes that xsd.exe uses to generate the typed dataset using codedom). It works OK. I can email it to you if you wish - it might help to throw some light on the problems you're having. Send me an email at joseph_cooney (at) hotmail.com if you want me to email it to you.
Enjoy Every Sandwich wrote Take Outs for 9 March 2004
on Tue, Mar 9 2004 5:42 PM
You've been Taken Out! Thanks for the good post.
Peter's Gekko wrote Importing datasets in a VS solution
on Tue, Mar 9 2004 8:05 PM
Importing datasets in a VS solution
Gerrard wrote re: What am I missing ?
on Wed, Apr 7 2004 4:02 PM
add quotation marks around the attribute values of the schema element. This isn't HTML!

;)

targetNamespace="http://www.testgekko/pp/DataSet1.xsd"
Peter wrote re: What am I missing ?
on Thu, Apr 8 2004 2:39 AM

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us