Filling typed datatset error,,,,

Discussion in 'ASP .Net' started by Darren Clark, Aug 30, 2004.

  1. Darren Clark

    Darren Clark Guest

    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>
    Darren Clark, Aug 30, 2004
    #1
    1. Advertising

  2. 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

    "Darren Clark" <> wrote in message
    news:...
    > 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>
    >
    >
    Eliyahu Goldin, Aug 30, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ersin Gençtürk
    Replies:
    1
    Views:
    3,479
    Ersin Gençtürk
    Oct 6, 2004
  2. tshad

    Error filling DropdownList

    tshad, Nov 11, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    744
    =?Utf-8?B?dGlta2xpbmc=?=
    Nov 12, 2005
  3. Yingjie Lan
    Replies:
    4
    Views:
    300
    John Nagle
    Jan 29, 2010
  4. Mohsen Pahlevanzadeh
    Replies:
    0
    Views:
    116
    Mohsen Pahlevanzadeh
    Sep 9, 2013
  5. MRAB
    Replies:
    0
    Views:
    115
Loading...

Share This Page