all groups > dotnet xml > february 2007 >
You're in the

dotnet xml

group:

DataSet/XmlSchema/DataGrid Framework 1.1 - 2.0 Problem


DataSet/XmlSchema/DataGrid Framework 1.1 - 2.0 Problem Martin Madreza
2/26/2007 7:25:09 AM
dotnet xml:
Hi,

I have a problem with reading an XmlSchema with Frameowk 2.0 and an
own DataType. I found no example
(searching two days).

What I do is:

DataSet dataSet = new DataSet();
dataSet.ReadXml("{path}/MySchemaAndData.xml");

dataView = dataSet.Tables[0];
dataGridView.DataSource = dataView;

Easy with Framework 1.1 (VisualStudio 2003). Everything is working
fine. Now with rameowrk 2.0 I get one
error after another, maybe someone can help me solve the problem,
knows a link or what ever. I'm really
despairing.

If need, i can write more information, what i tried unsuccesfully for
the last 20h.

The Schema looks like following:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Data version="V1.0.0.0">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="daten"
xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="data" msdata:IsDataSet="true" msdata:Locale="de-
DE">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="aTableName" msdata:Expression="Column">
<xs:complexType>
<xs:attribute name="Column" type="xs:string"
type="xs:string" msdata:DataType="MyNamespace.MyClass, MyAssemlyName,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>/>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<aTableName Column="1"/>
</Data>
Re: DataSet/XmlSchema/DataGrid Framework 1.1 - 2.0 Problem John Saunders
2/26/2007 12:40:05 PM
[quoted text, click to view]
As a first guess, I'd suggest you extract that schema from the data.
Secondly, your data does not match your schema. "Data" is not the same as
"data".

John

Re: DataSet/XmlSchema/DataGrid Framework 1.1 - 2.0 Problem Martin Madreza
2/27/2007 1:21:36 AM
hi,

yes sorry, i copied the schema from the original and modified a litte
(from german tio english)...

i extract the dqata from the data set with a testproject, the result
is, that

'msdata:DataType="MyNamespace.MyClass, MyAssemlyName'

becomes an element. it's not possible to set them (in the dataset) to
an attribute. the element is under a xs:sequence, and the structur
changes...

so far it works. but i cant set the value from the schema. in the
example below column value 1 is never set. in 1.1 everything works,
now i found nothing about what changed in 2.0 and what i have to
change to make it work. does any example exist with DataType =
OwnDataType?

hope you can help me to come forward... and sorry for the bad example.
if something ambiguous, please tell and i try to specify it

here is the example

<?xml version="1.0" standalone="yes"?>
<data>
<xs:schema id="data" xmlns="" xmlns:xs="http://www.w3.org/2001/
XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="data" msdata:IsDataSet="true" msdata:Locale="de-
DE">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="aTableName">
<xs:complexType>
<xs:sequence>
<xs:element name="Column" type="xs:string"
msdata:DataType="MyNamespace.MyClass, MyAssemlyName, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null"/>/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<aTableName>
<Column>1</Column>
</aTableName>
</data>
AddThis Social Bookmark Button