473,396 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

reading a schema into a dataset problem.

I am using the ReadXMLSchema method of system.data.dataset to read a schema into a dataset.

I have an XML file that I build up and wish to do a .Update against a database.

The dataset doesn't have a schema and takes the following form:

xml:

<?xml version="1.0" encoding="utf-8"?>
<DataSetEntities xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:guids="urn:schemas-microsoft-com:guids" xmlns="C:/DACXML/EntityAttribute.xsd">
<Entity>
<EntityId>319f8e68-2bf2-444c-b0e7-0baa1c069a12</EntityId>
<Name>Candidate</Name>
<PhysicalName/>
<LogicalName>Candidate</LogicalName>
<IsMappable>true</IsMappable>
<EntityMask>0</EntityMask>
<DataSourceId>a3a1a14e-51d9-44b4-b0da-b5b564b405b1</DataSourceId>
</Entity>
<Attribute>
<AttributeId>7957b56a-59f7-412c-b0dc-7784d70381c1</AttributeId>
<AttributeTypeId>cedd0a61-8699-40e9-96e0-00165659eb3a</AttributeTypeId>
<Name>CandidateID</Name>
<PhysicalName>CandidateID</PhysicalName>
<Length/>
<isNullable>false</isNullable>
<Default>newid()</Default>
<EntityId>319f8e68-2bf2-444c-b0e7-0baa1c069a12</EntityId>
<LogicalName>CandidateID</LogicalName>
<IsPK>true</IsPK>
</Attribute>
<Attribute>
<AttributeId>4a7ee005-64d1-4a3b-9b84-e021344e9874</AttributeId>
<AttributeTypeId>41a5626e-2d8f-45a2-9415-d4ddf3bf7971</AttributeTypeId>
<Name>Surname</Name>
<PhysicalName>Surname</PhysicalName>
<Length/>
<isNullable>false</isNullable>
<Default>test</Default>
<EntityId>319f8e68-2bf2-444c-b0e7-0baa1c069a12</EntityId>
<LogicalName>Surname</LogicalName>
<IsPK>false</IsPK>
</Attribute>
<Attribute>
<AttributeId>aa8d232b-9cb3-458c-8f66-4f3b151b7924</AttributeId>
<AttributeTypeId>7d3bd9b9-7f3e-49e4-b1d5-d6bc7fbf9ce8</AttributeTypeId>
<Name>DOB</Name>
<PhysicalName>DOB</PhysicalName>
<Length/>
<isNullable>true</isNullable>
<Default>GetDate()</Default>
<EntityId>319f8e68-2bf2-444c-b0e7-0baa1c069a12</EntityId>
<LogicalName>DOB</LogicalName>
<IsPK>false</IsPK>
</Attribute>
</DataSetEntities>
schema i load in:

<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="en-GB">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Entity">
<xs:complexType>
<xs:sequence>
<xs:element name="EntityId" type="xs:string" minOccurs="0" />
<xs:element name="Name" type="xs:string" minOccurs="0" />
<xs:element name="PhysicalName" type="xs:string" minOccurs="0" />
<xs:element name="LogicalName" type="xs:string" minOccurs="0" />
<xs:element name="IsMappable" type="xs:string" minOccurs="0" />
<xs:element name="EntityMask" type="xs:string" minOccurs="0" />
<xs:element name="DataSourceId" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Attribute">
<xs:complexType>
<xs:sequence>
<xs:element name="AttributeId" type="xs:string" minOccurs="0" />
<xs:element name="AttributeTypeId" type="xs:string" minOccurs="0" />
<xs:element name="Name" type="xs:string" minOccurs="0" />
<xs:element name="PhysicalName" type="xs:string" minOccurs="0" />
<xs:element name="Length" type="xs:string" minOccurs="0" />
<xs:element name="isNullable" type="xs:string" minOccurs="0" />
<xs:element name="Default" type="xs:string" minOccurs="0" />
<xs:element name="EntityId" type="xs:string" minOccurs="0" />
<xs:element name="LogicalName" type="xs:string" minOccurs="0" />
<xs:element name="IsPK" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

I read the schema in first with a ReadXMLSchema, i then use
ReadXml(sr,XmlReadMode.IgnoreSchema); where sr is the XML file above (dataset)

The dataset never polutes and when i do a .GetXML() i only get <DataSetEntities />
and not the full XML file, is there a problem with the XML.

any ideas?

cheers

chris.


************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 12 '05 #1
0 1440

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
10
by: Al Christoph | last post by:
Please forgive me if this is the wrong place to post this. The last place I posted got me a fairly rude response. I guess vb.db people just don't want to think about XML as database. At any rate,...
7
by: Sharon | last post by:
I have successfully loaded a DataSet object with a XML schema (XSD). Now I wish to populate the tables that was created in the DataSet. I have an XML file/string that contain all the needed data...
3
by: Paul Bromley | last post by:
I have an application that needs to utilise an XML file produced by an external application. However I am having problems getting this into a Dataset using...
1
by: hzgt9b | last post by:
(FYI, using VB .NET 2003) Can someone help me with this... I'm trying to read in an XML file... it appears to work in that the DataSet ReadXML method dose not fail and then I am able to access the...
4
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0...
0
by: c.w.browne | last post by:
Hi, Ive had a bit of a look around for other people with this problem and cant find anything that solves it in my case, so I'm afraid im going to have to bother you all with a post of my own. ...
13
by: Martin Z | last post by:
I'm making a CRUD screen for an Oracle database... but problem is that the primary key in that table is populated via an autonumber, which in Oracle is done just with triggers and sequences. ...
5
by: Lucvdv | last post by:
This would better be described by 'serialization' than 'interop', but I didn't find a newsgroup that seems closer on topic. The problem in a few words: I save data with DataSet.WriteXML, but I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.