Xmlschema and dataset problems

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

Does anyone know what is causing this problem?
-----------
OhsReport.xml
--------------
<?xml version="1.0" standalone="yes"?>
<ohsReportList 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="ohsReportList"
targetNamespace="http://tempuri.org/OhsReport.xsd"
xmlns:mstns="http://tempuri.org/OhsReport.xsd"
xmlns="http://tempuri.org/OhsReport.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:element name="ohsReportList" msdata:IsDataSet="true"
msdata:Locale="en-AU">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <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="ReportDate" 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="Description" type="xs:string"
minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>

0
ree32 (9)
8/4/2005 5:31:38 AM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
480 Views

Similar Articles

[PageSpeed] 49

Forget about it

I found that if i let the dataset read the xmlschema using
ds.ReadXmlSchema(Server.MapPath("data\ohsReport.xsd")
then loading the Xml afterwards works.

0
ree32 (9)
8/4/2005 5:51:15 AM
Reply:

Similar Artilces:

dll problem
Friends, When I'm in outlook and try to use an email link, I get the following: c:\documents and settings\owner\my documents\setuprsc.dll not found. Any ideas. Thanks for your help ...

Exchange Server Problem (I need help)
Hello to you all! The medical clinic I work at has a network. We all have our own email address. Mine, for example is lpeacock@elcardiologist.com. The problem is this. I can send out email as much as I want and they go where I need them to go. However, when anyone attempts to send any of us email, to our work, we don't get them. Now we had experianced some MAJOR problems recently in the past to where the actual IT lady had to set everything back up because things just went down. So our email accounts worked without any problems. But now, we can't recieve anything from an...

CAsyncSocket OnRecive Problem
Hello , I am writing simple server , i derived a class from CAsyncSocket and overrided OnAccept and OnRecive. this is the code void AsyncSock::OnReceive(int nErrorCode) { CString m_strRecv; CString strData; LPTSTR szstr=strData.GetBuffer(256); memset(szstr,0,256); int nRead; nRead = Receive( szstr,sizeof(szstr),0 ); switch (nRead) { case 0: Close(); break; case SOCKET_ERROR: if (GetLastError() != WSAEWOULDBLOCK) { AfxMessageBox ("Error occurred"); Close(); } ...

Opening shared worksheet problem
We have a user that has a worksheet in a shared folder on her pc. She shares the folder with two other users in the office. When she opens this one particular spreadsheet, she can see her latest changes for only a couple of seconds and then the spreadsheet reverts to the original. Is there a solution or explanation for this problem? ...

emailing worksheet problem
all, i use the following code to gather email addresses and then email a worksheet to the gathered addressees. this routine works great in debug mode. when i attempt to execute without the debugger it fails miserably. any ideas? thanks in advance for your help, danny Sub SendActiveWorkSheet() Dim strEmailTo() As String Dim strSubject As String Dim strPrompt As String Dim strWorksheetIndex As String Dim intCounter As Integer Dim intEmailCount As Integer Dim intAnswer As Integer intCounter = 2 intEmailCount = 0 strSubject = "EOM Spread...

Problems Copy/Paste from Excel
About two weeks ago I installed Firefox as a web browser. Within about two hours of installing it, I could not copy tables in Excel and paste them into Publisher unless I hit the copy (Alt-C) about a dozen times. Finally, I'd be able to do it. I uninstalled Firefox within minutes, and installed Office a couple of times, but alas, my copy/paste function is still faulty in Publisher. As I said, eventually, it kicks in and I can paste, but I have to repeat copy/paste about a dozen times to get it to work. I've looked everywhere in the Firefox documentation to fix the registry, and ...

Problem with a CDaoRecordSet
Hello gruop. I'm novice in VC. I'm programming a aplication with MDI and I'm using a CDaoRecordset but I have two problem. 1. How can I connect the CDaoRecordset with my MySQL database? In the wizard I only can connect the CDaoRecordset with a database file (*.mdb) but ir doesn't give the option to use another type of database. 2. In the CDaoRecordwiew of CDaoRecordset, how can I insert a grid control? For me, is the same that the grid control are DBGrid, MsGrid, FlexGrid or another. Can anybody help me? Thanks in advance. ...

Finding a number and debug problem
I recorded a macro and fails. When I do a find or a search and replace, I notice that if it can't find the number it goes into debug. Is there away to search for a number in a column and select the row it is in so I can copy the record with out the debug running when it can't find a number? It's usually better to check to see if it's found in your code first. dim FoundCell as range dim myVal as long myval = 23 'or something with activesheet.range("a:a") Set FoundCell = .Find(What:=myVal, After:=.Cells(.cells.count), _ LookIn:=xlV...

Problems with fonts
Hi all, my name is Wai Shum. I am using office v. X. I have a problem changing fonts on my documents. Here's the situation. When I choose one font, the font box on the tool bar shows another font type. Example, I choose Times New Roman, but the box shows Arial. When I go to scroll down the font menu, the check mark is on Times New Roman. Would somebody help me, please? Thank You! Exactly what version of Office X? http://www.mcgimpsey.com/macoffice/office/vxversions.html Turning off WYSIWG in the font menu has been known to fix some glitches, see Word>Preferences>General. On 6/9...

'Compare data and append' Problem
Hi, I really hope that there is an easy way to do this..! I have a big sheet of data with maybe 60 columns and 3500+ rows all showing relative values to the headers in the first row of each column. It's actually data about how a telephones are configured on a large system, so the headers contain things like Extn Number, Port Number etc etc. Most of the columns are actually pretty irrelevant. Now, I have another sheet that only contains two columns defined as 'Extn number' and 'Desk Location'. This is valuable data that's hard to come by. I want to do some sort of lo...

Select problem
I have a spreadsheet when I put my cursor on a cell, instead of selecting the cell it selects an area of my cells and it moves them instead of selecting a specific cell. How can I stop this so that I can select individual or group of cells without moving the entire area of my information? Thank you in advance HankL Press F8 again to turn off "Extend" HankL wrote: > I have a spreadsheet when I put my cursor on a cell, instead of selecting > the cell it selects an area of my cells and it moves them instead of > selecting a specific cell. > > How can I stop...

Problem editting shared Tasks
My boss has shared his outlook task folder, so we can see our own tasks, tasks of other peoples, and also add tasks of our own to it. The problem is, when the task is assigned to someone (anyone), it immediately becomes read-only. Even if i have "Owner" permission, which has "Edit items" set to all, I cannot edit the task. We need to be able to edit the text of the task, in order to update and correct the task, and add extra info. I'm probably missing a setting somewhere, but I'm not sure what we need to do to fix it! Any ideas? Thanks. As far as I know, o...

XmlSchema not loading from XmlTextReader
For some reason, the schema seems to be empty every time it's loaded. Does anyone have any ideas?? Thanks! Here's the code: Dim xsd As System.Xml.Schema.XmlSchema Dim io As New System.IO.FileStream(xsdFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read) Dim x As New System.Xml.XmlTextReader(io) xsd = System.Xml.Schema.XmlSchema.Read(x, New System.Xml.Schema.ValidationEventHandler(AddressOf XsdValidationError)) .... .... .... Public Shared Sub XsdValidationError(ByVal sender As Object, ByVal args As System.Xml.Schema.ValidationEventArgs) throw new exception (&q...

RichTextBox LoadFile Problem
Hello, I'm writing an application in Visual C++ 6.0, and I am trying to dynamically load a file into the text box, during runtime. The code is located in the OnInitDialog() Function. The code I'm Using is as follows: m_myRichTextBox("C:\\myFile.rtf", RichEditStreamType.RichText); But when I compile it, I get the error: error C2065: 'RichEditStreamType' : undeclared identifier and error C2228: left of '.RichText' must have class/struct/union type Does anyone out there know why this would be? Is there another way of Dynamically loading data into the Rich ...

experts: structure of dataset xml
hello, i have a problem, i wonder if anyone can help... i am retrieving records from an access table using a dataset and want the data to be returned in xml, so i am using the dataset.GetXml() method. lets say, for example, that the xml is in the following format: <Users> <User> <UserId>1</UserId> <Username>robert</Username> <Password>friend</Password> </User> <User> <UserId>2</UserId> <Username>natasha</Username> <Password>sunny</Password...

Worksheet Problem
I have a excel doc that has 4 tabs(sheets) named AIX, HPUX, Windows Other. Each sheet is a listing of all our servers of each type and th relevant info on each (hostname, location, version, vendor, dat purchased, etc..). Each sheet is also auto-filtered on the top row b these categories. I would like to add a 5th sheet called "All" that list's all of ou servers on one sheet. Is there a way to create this sheet so i automatically gets it's data from the other sheets and is updated whe the others are updated? Thanks -- Message posted from http://www.ExcelForum.com I th...

xml and dataset
I want to take a dataset and save the data as an xml document. I know how to do this, but I need the xml to be formatted in a certain way. What are my options? I have thought about using a stylesheet to format from xml to xml. I can create an xsd, but that does not seem to save the dataset the way I need it. It just adds the schema to the top, but does not put the xml in a hierarchical format. TypedDataSet.WriteXml("C:\Test.xml", XmlWriteMode.WriteSchema) Hi Ken, You can do it using the XMLdoc. Because I do not know what you are reformating it is difficult to say more. Cor...

OLE Automation Excel OpenText slow problem
Hi! Attachment is the testing project ,put the two files into d:\, d:\\kor-kor-csv-.NETFramework11.xls can be any .xls file, you use one .xls file to save as a csv file then use my project to do test, you can also change the code to other location. You can see OpenText method has such big difference on .xls and .csv files, so i just want to know if we can make OpenText on .csv files faster, just like .xls. Sorry, attachment can't be uploaded. It's urgent. Thanks a lot! BRGs ben Hi Ben, If you could not upload your test project(zipped) as an attachment in the post, ...

Form Problem 06-20-07
I have a database that contains companies and employees. I have created a form that will allow the user to select the company and pull a report of the employees at that company. My problem is that the data changes without me making changes. I will pull the list of a company and an employee that is not with that company will be listed on the report for another company. I have no clue as to what is happening. Does anyone have any suggestions or advice? What is the query used to pull your report? Post the SQL view here. -- Hope that helps! RBear3 .. <ckunerth@gmail.com> wrote in mess...

Right Click problem
All of a sudden I can not right click without getting an error that widnows explorer was closing. I recently installed Norton 2010 - has anyone discovered a problem with Norton? How can I address this? Thanks Sat, 24 Apr 2010 12:02:06 -0400 from Richard <richx@optonline.net>: > > All of a sudden I can not right click without getting an error that widnows > explorer was closing. I recently installed Norton 2010 "Doctor, it hurts when I do this." "Well, stop doing it." Whatever you had hoped to do with Norton can be done better and ...

Problem with Range
Hello All, Using Windows & Excel XP. I have a worksheet that has times located in every other column, A1:A30, C1:C30, E1:E30. I then name the range "times". I want to find the count of times that are between 0:30:00 and 0:39:59 (30 and 39:59 minutes). I write the formula: =COUNTIF(times,">=" & TIME(0,30,0)) - COUNTIF(times,">=" & TIME(0,39,59)) but get the error #VALUE! I have tried writing a formula for times in one column and consecutive columns and it gives the correct count, it is just when the times in every other column that th...

Problems Sending Email
Whenever I try to send an email message, I get this error message. Server Response: '550 relaying mail to hotmail.com is not allowed', Port: 25, Secure(SSL): No, Server Error: 550, Error Number: 0x800CCC79 It's just on one of my computers though. On another computer using the same email account, I'm able to send mail without errors. Any help will be greatly appreciated. Jon You probably need to authenticate to your outgoing server. You can do so on the "Outgoing Server" tab for your account. -- Jeff Stephenson Outlook Development This posting is provided ...

sorting problem
Hello, In WLM, Is it possible to sort messages by two columns? For example, in Outlook Express, I have my messages ordered by receiving date, then I click on "Sender" column and get my messages ordered by Sender, then by Date. Such behavior is standard for Windows list controls. In WLM, clicking on Sender columns destroys sorting by date, which makes it much more difficult to find relevant messages from given Sender. Wapper You can only sort on a single column reliably. That's true even in Outlook Express. Although it's been your experience that sorti...

How do I read an XmlDocument object into a dataset???
I need to read an in-memory instance of a loaded XmlDocument into a referenced DataSet. What's the best way to do this? I've tried "myDataSet.ReadXml(myXmlDocument)" but it won't compile. I get a compile error because the XmlDocument type isn't accepted by the ReadXml() method. I need to figure this out! Thanks, ~A~ Blah - nevermind. I don't need the xmldocument - I just feed the xml stream straight into the dataset. Thanks, ~A~ "Kewlpack" wrote: > I need to read an in-memory instance of a loaded XmlDocument into a > referenced DataSet....

galmod32 problems
saw your post we are trying to use galmod32 for exchange2k running on win2k active directory server. I followed directions for delegating self to active directory. No matter what I do only a domain admin can change any info. I have a user that is just a domain user and it looks like evrything went fine but no info is posted to active directory or is viewable in the gal. I make that user a domain admin and instant success help please!!! ...