My Assistant
![]() ![]() |
|
|
Sep 3 2009, 03:20 PM
Post
#1
|
|
|
UtterAccess Addict Posts: 181 |
Hello,
Is anyone familiar with basing a c# DataSet on an xml schema? As I understand it, you can create the DataSet object, then associate to an xml schema (.xls), then when the DataSet is loaded with the xml transaction it will have alll the xml elements in it. My code to do this is giving the error: "The schema namespace is invalid. Please use this one instead: http://www.w3.org/2001/XMLSchema. at System.Data.DataSet.ReadXmlSchema(XmlReader reader, Boolean denyResolving) at System.Data.DataSet.ReadXmlSchema(TextReader reader) at postReturn.Page_Load(Object sender, EventArgs e)” I created the schema file from a very simple query export from Microsoft Access 2002 and I did edit this file to change the namespace from http://www.w3.org/2000/10/XMLSchema (given from the MS Access export) to http://www.w3.org/2001/XMLSchema (as suggested by the error message). Here is the c# code to associate the DataSet to the schema: try { string sch = Server.MapPath("mySchema.xls”); System.IO.StreamReader myStreamReader = new System.IO.StreamReader(sch); ds.ReadXmlSchema(myStreamReader); myStreamReader.Close(); } catch (Exception ex) { Response.Write("ERROR dataSet did not associate to schema: " + ex.ToString()); throw ex; } But, this did not help - I still get the same error message complaining about the namespace. Much appreciation if someone can shed some light on this, Jay |
|
|
|
Sep 6 2009, 11:53 AM
Post
#2
|
|
|
UtterAccess Editor Posts: 15,978 From: Northern Virginia, USA |
I am assuming from you post on 2009-09-04 you would able to work this out?
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 10:51 PM |