.NETGURU
ReadXML
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngxml' list.


renevazquez@cimex.com.cu
I tried to load this xml into a typed dataset and the only thing that
load into it is: <dsPart/>

this is the code that I use to load the XML:

dsPart dsPartAux = new dsPart();
dsPartAux.ReadXml("http://localhost/RMAapp/RMAapp_WebUI/Parts.xml");

Parts.xml

<dsPart>
<Parts>
<partNo>x5</partNo>
<descr>hd</descr>
<price>100</price>
<ret>true</ret>
<sentaiCode>345</sentaiCode>
</Parts>
</dsPart>

I wish to know why the dataset do not fill with the xml if the schema
of the dataset appear to match with the xml in the file specified.

this is the schema that define my typed dataset

thanks a lot in advance.

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="dsPart" targetNamespace="http://tempuri.org/dsPart.xsd";
elementFormDefault="qualified" attributeFormDefault="qualified"
xmlns="http://tempuri.org/dsPart.xsd";
xmlns:mstns="http://tempuri.org/dsPart.xsd";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="dsPart" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Parts">
<xs:sequence>
<xs:element name="partNo" type="xs:string" />
<xs:element name="descr" type="xs:string" />
<xs:element name="price" type="xs:decimal" />
<xs:element name="ret" type="xs:boolean" />
<xs:element name="sentaiCode" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name="dsPartKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Parts" />
<xs:field xpath="mstns:partNo" />
</xs:unique>
</xs:element>
</xs:schema>

Reply to this message...
 
    
Jason Zhu
The schema is different, since the schema has the namespace while the
instance input does not.
Jason

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, June 27, 2002 10:40 AM
To: aspngxml
Subject: [aspngxml] ReadXML

I tried to load this xml into a typed dataset and the only thing
that=20
load into it is: <dsPart/>
=20
=20
=20
this is the code that I use to load the XML:
=20
dsPart dsPartAux =3D new dsPart(); =20
=20
dsPartAux.ReadXml("http://localhost/RMAapp/RMAapp_WebUI/Parts.xml");
=20
=20
Parts.xml
=20
<dsPart>
<Parts>
<partNo>x5</partNo>=20
<descr>hd</descr>=20
<price>100</price>=20
<ret>true</ret>=20
<sentaiCode>345</sentaiCode>=20
</Parts>
</dsPart>
=20
=20
I wish to know why the dataset do not fill with the xml if the
schema=20
of the dataset appear to match with the xml in the file specified.
=20
this is the schema that define my typed dataset
=20
thanks a lot in advance.
=20
=20
<?xml version=3D"1.0" encoding=3D"utf-8" ?>
<xs:schema id=3D"dsPart"
targetNamespace=3D"http://tempuri.org/dsPart.xsd";=20
elementFormDefault=3D"qualified" attributeFormDefault=3D"qualified" =

xmlns=3D"http://tempuri.org/dsPart.xsd";=20
xmlns:mstns=3D"http://tempuri.org/dsPart.xsd";=20
xmlns:xs=3D"http://www.w3.org/2001/XMLSchema";=20
xmlns:msdata=3D"urn:schemas-microsoft-com:xml-msdata">
<xs:element name=3D"dsPart" msdata:IsDataSet=3D"true">
<xs:complexType>
<xs:choice maxOccurs=3D"unbounded">
<xs:element name=3D"Parts">
<xs:sequence>
<xs:element name=3D"partNo" type=3D"xs:string" />
<xs:element name=3D"descr" type=3D"xs:string" />
<xs:element name=3D"price" type=3D"xs:decimal" />
<xs:element name=3D"ret" type=3D"xs:boolean" />
<xs:element name=3D"sentaiCode" type=3D"xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:unique name=3D"dsPartKey1" msdata:PrimaryKey=3D"true">
<xs:selector xpath=3D".//mstns:Parts" />
<xs:field xpath=3D"mstns:partNo" />
</xs:unique>
</xs:element>
</xs:schema>

| [aspngxml] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification