Deserialize to DataSet - DataType ? acts like bug.
From: andrewcw (andrewcw_at_acw.com)
Date: 05/14/04
- Next message: Somebody_Out_There: "convert untyped datatable/dataset into strongly typed"
- Previous message: Frank Oquendo: "Re: C# ClassLibrary External Interface"
- Next in thread: Jeffrey Tan[MSFT]: "RE: Deserialize to DataSet - DataType ? acts like bug."
- Reply: Jeffrey Tan[MSFT]: "RE: Deserialize to DataSet - DataType ? acts like bug."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 14 May 2004 13:01:02 -0700
I read in a earlier post that I can get the column of a grid to sort by datetime if the column type was set as Date.
I deserialize my XML and one attribute of the XSD has type as dateTime but upon inspection and behavior in the grid
the data type is string. If I preview the dataset with the GUI in VISSTUDIO it shows my datatype to be dateTime ...
If I try to rest the datatype I get this error
Additional information: Cannot change DataType of a column once it has data.
This adds 2 new tables ...
FileStream finschema= new FileStream(schemaPath,FileMode.Open,FileAccess.Read,FileShare.Read);
ds.ReadXmlSchema(finschema);
finschema.Close();
Table 0
System.String
System.String
System.String
System.String // should have been dateTime !!!
System.String
System.String
System.Int32
Table 1
System.String
System.Int32
Finally if If I try to rest the datatype I get this error
Additional information: Cannot change DataType of a column once it has data.
What's wrong ??? Thanks Andrew
?xml version="1.0" encoding="UTF-8" ?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"><xs:element name="transactionrecord"><xs:complexType><xs:sequence><xs:element ref="message" /></xs:sequence><xs:attribute name="customercode" type="xs:string" use="optional" /><xs:attribute name="model" type="xs:string" use="optional" /><xs:attribute name="documentid" type="xs:string" use="optional" /><xs:attribute name="transactiondate" type="xs:dateTime" use="optional" /><xs:attribute name="transactiontype" type="xs:string" use="optional" /></xs:complexType></xs:element><xs:element name="transactions"><xs:complexType><xs:sequence><xs:element ref="transactionrecord" maxOccurs="unbounded" /></xs:sequence><xs:attribute name="application" type="xs:string" use="optional" /></xs:complexType></xs:element><xs:element name="message"></xs:element></xs:schema>
- Next message: Somebody_Out_There: "convert untyped datatable/dataset into strongly typed"
- Previous message: Frank Oquendo: "Re: C# ClassLibrary External Interface"
- Next in thread: Jeffrey Tan[MSFT]: "RE: Deserialize to DataSet - DataType ? acts like bug."
- Reply: Jeffrey Tan[MSFT]: "RE: Deserialize to DataSet - DataType ? acts like bug."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|