Filling typed datatset error,,,,

D

Darren Clark

basicaly i want to set this XSD up so that it ALLOWS null values.. and
doesnt through me any stupid constriant errors..

How can i set a default on a datetime field?


<xs:sequence>

<xs:element name="id" msdata:ReadOnly="false" msdata:AutoIncrement="false"
type="xs:int" />

<xs:element name="body" type="xs:string" minOccurs="0" codegen:nullValue=""
/>

<xs:element name="active" type="xs:boolean" codegen:nullValue="0"
default="0" />

<xs:element name="approved" type="xs:boolean" codegen:nullValue="0"
default="0" />

<xs:element name="approved_by" type="xs:int" codegen:nullValue="0"
default="0" />

<xs:element name="approved_date" type="xs:string" minOccurs="0"
codegen:nullValue="1980-01-01T00:00:00" />

<xs:element name="create_date" type="xs:string" minOccurs="0" />

<xs:element name="create_by" type="xs:int" minOccurs="0"
codegen:nullValue="0" default="0" />

<xs:element name="update_date" type="xs:string" minOccurs="0" />

<xs:element name="update_by" type="xs:int" minOccurs="0"
codegen:nullValue="0" default="0" />

<xs:element name="creator" type="xs:string" minOccurs="0"
codegen:nullValue="" default="" />

<xs:element name="approver" type="xs:string" minOccurs="0"
codegen:nullValue="" default="" />

<xs:element name="updator" type="xs:string" minOccurs="0"
codegen:nullValue="" default="" />

</xs:sequence>
 
E

Eliyahu Goldin

For me minOccurs="0" works just fine. What namespaces do you have in the
<xs:schema ...>? I have the following:

xmlns:mstns="http://tempuri.org/dsImmunization.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"

Also, you set type="xs:string". I set type="xs:date". Example:

<xs:element name="RecommendedDate" type="xs:date" minOccurs="0" />

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top