473,836 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Xmlschema and dataset problems

When I try and load an xmldocument with its schema into an dataset. It
always returns 0 tables.
ds.ReadXml(Serv er.MapPath("\" & "data\ohsReport .xml",
XmlReadMode.Rea dSchema)

Does anyone know what is causing this problem?
-----------
OhsReport.xml
--------------
<?xml version="1.0" standalone="yes "?>
<ohsReportLis t xmlns="http://tempuri.org/OhsReport.xsd">
<ohsReport>
<ID>0</ID>
<Staff>0</Staff>
<ReportDate>1/01/2005</ReportDate>
<Type />
<Subject />
<Description />
</ohsReport>
<ohsReport>
<ID>1</ID>
<Staff>1143</Staff>
<ReportDate>4/08/2005</ReportDate>
<Type>Other</Type>
<Subject>Test </Subject>
<Description />
</ohsReport>
<ohsReport>
<ID>2</ID>
<Staff>1143</Staff>
<ReportDate>4/08/2005</ReportDate>
<Type>Other</Type>
<Subject>Test </Subject>
<Description>xc </Description>
</ohsReport>
<ohsReport>
<ID>3</ID>
<Staff>1143</Staff>
<ReportDate>4/08/2005</ReportDate>
<Type>Other</Type>
<Subject>Test </Subject>
<Description>xc </Description>
</ohsReport>
<ohsReport>
<ID>4</ID>
<Staff>1143</Staff>
<ReportDate>4/08/2005</ReportDate>
<Type>Other</Type>
<Subject>Test </Subject>
<Description>xc </Description>
</ohsReport>
<ohsReport>
<ID>5</ID>
<Staff>1143</Staff>
<ReportDate>4/08/2005</ReportDate>
<Type>Other</Type>
<Subject>Test </Subject>
<Description>xc </Description>
</ohsReport>
</ohsReportList>
-----------
OhsReport.xsd
--------------

<?xml version="1.0" standalone="yes "?>
<xs:schema id="ohsReportLi st"
targetNamespace ="http://tempuri.org/OhsReport.xsd"
xmlns:mstns="ht tp://tempuri.org/OhsReport.xsd"
xmlns="http://tempuri.org/OhsReport.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata"
attributeFormDe fault="qualifie d" elementFormDefa ult="qualified" >
<xs:element name="ohsReport List" msdata:IsDataSe t="true"
msdata:Locale=" en-AU">
<xs:complexType >
<xs:choice maxOccurs="unbo unded">
<xs:element name="ohsReport ">
<xs:complexType >
<xs:sequence>
<xs:element name="ID" type="xs:string " minOccurs="0" />
<xs:element name="Staff" type="xs:string " minOccurs="0"
/>
<xs:element name="ReportDat e" type="xs:string "
minOccurs="0" />
<xs:element name="Type" type="xs:string " minOccurs="0" />
<xs:element name="Subject" type="xs:string " minOccurs="0"
/>
<xs:element name="Descripti on" type="xs:string "
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

Nov 12 '05 #1
1 1164
Forget about it

I found that if i let the dataset read the xmlschema using
ds.ReadXmlSchem a(Server.MapPat h("data\ohsRepo rt.xsd")
then loading the Xml afterwards works.

Nov 12 '05 #2

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

Similar topics

2
9095
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any other declaration. An error occurred at , (11, 3). Schema compile error: System.Exception: Schema error ---> System.Xml.Schema.XmlSchemaException: May no
0
1353
by: John | last post by:
Hi, I'm creating a component to generate a schema file much like VS generates for DataSets. I'm using XmlSchema to do the job and I also am using a XmlNamespaceManager to manage namespaces. XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt); nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema"); nsmgr.AddNamespace("msdata", "urn:schemas-microsoft-com:xml-msdata"); nsmgr.AddNamespace("mstns",...
1
1421
by: Beanweed | last post by:
I am writing a web service in C#. One method queries a database for xml formatted data and responds to the requester with an XMLDocument (this part works fine). What I want now is another method that will return the schema for that document. My idea is to create a DataSet using the xml document and inferring its schema (the data sources for these xml docs are varied). Then the schema could be extracted from the dataset and sent to the...
4
1496
by: 101 | last post by:
I get a security error when trying to write out to an XMLSchema file "myDs.WriteXmlSchema(strXMLSchemaFile)". I am running XP SP2, No Domain, MS file and print sharing uninstalled. I was able to get past this by making ASPNET part of the Administrators group. I tried the Power User group (as well as others) to no avail. I also had to install MS file and print sharing in order to even add ASPNET as a member of the Administrator group (or...
0
1016
by: rafaelgaucho | last post by:
Hi, I have a web service that return a Dataset. I want to get xml result from GetXml method of DataSet class like this: <xml... .> <MyDataSet xmlns="ssss\mySchema.xsd> <Table1> <RecordTable1> <id>1</id>
2
1530
by: MyndPhlyp | last post by:
I am attempting to write a DLL to maintain an XML file. It creates its own XSD as an XmlSchema (or even a compiled member of an XmlSchemaSet, if necessary). I don't want to write an XSD to disk. The XML file, on the other hand, will be disk resident. System.Data.DataSet wants to read its schema in from an XmlReader, Stream, TextReader, or file name string.
2
3699
by: Martin Madreza | last post by:
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");
1
4030
by: Ryan | last post by:
Hello Xml Gurus, I'm trying to build an XML schema in memory using the System.Xml.XmlSchema namespace objects, validate it, and then write it to a file. The problem I'm facing is that XmlSchema.Write() is changing <xsd:element minOccurs="1" name="AccountId" type="s-xsd:primarykey" /> to be
0
2039
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned for further use. To create the schema I am using the XMLSchema classes and the result is the
0
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10819
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9349
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7771
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6972
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5641
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5811
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3100
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.