473,405 Members | 2,282 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,405 software developers and data experts.

ReadXml from resources

i saved the state of a data set and table via

MyDs.WriteXmlSchema("MyDs.xsd")
MyDs.WriteXml("MyDs.xml")

i was able to read them back in and display the info in the database by

MyDs.ReadXmlSchema("MyDs.xsd")
MyDs.ReadXml("MyDs.xml")

i put the 2 files into my project resources and named them Descrip and Info,
but when i tried reading them back thru

MyDs.ReadXmlSchema(My.Resources.Descrip)
MyDs.ReadXml(My.Resources.Info)

i get the error 'Illegal characters in path'

i'm assuming it is because ReadXml expects a filename, which
'My.Resources.Descrip' is not. i was able to read in the text of
'My.Resources.Descrip' into a text box, so the content is there.

how can i make this work?

thanks

ray

Dec 20 '06 #1
1 2356
The only overload that takes a string for ReadXml and ReadXmlSchema is
for a filename, that's why you are getting the error. One of the other
overloads takes a stream, so...

MyDs.ReadXmlSchema(new System.IO.StringReader(My.Resources.Descrip))
My.Ds.ReadXml(new System.IO.StringReader(My.Resources.Info))

Hope this helps

ray well wrote:
i saved the state of a data set and table via

MyDs.WriteXmlSchema("MyDs.xsd")
MyDs.WriteXml("MyDs.xml")

i was able to read them back in and display the info in the database by

MyDs.ReadXmlSchema("MyDs.xsd")
MyDs.ReadXml("MyDs.xml")

i put the 2 files into my project resources and named them Descrip and Info,
but when i tried reading them back thru

MyDs.ReadXmlSchema(My.Resources.Descrip)
MyDs.ReadXml(My.Resources.Info)

i get the error 'Illegal characters in path'

i'm assuming it is because ReadXml expects a filename, which
'My.Resources.Descrip' is not. i was able to read in the text of
'My.Resources.Descrip' into a text box, so the content is there.

how can i make this work?

thanks

ray
Dec 24 '06 #2

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

Similar topics

11
by: DraguVaso | last post by:
Hi, I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the...
1
by: Jeffrey A. Voigt | last post by:
I'm having trouble loading some xml data into a dataset via the ReadXML call. I'm loading into the dataset an xml schema prior to the ReadXML call. I see that there IS in fact, 3 records that...
1
by: mr_dom_is | last post by:
Hi I have a little bit of trouble, probably missing the point now sure but: I have a dataset dim ds as new dataset("User") Which is populated with data from a database. When I use
8
by: Nikhilesh Mehendale | last post by:
I have written a web service in C#, .NET 1.1 which reads a XML file into a dataset. This is just a plain XML file. First I use the Dataset.ReadXmlScheme function and pass the XML file to it. Then...
1
by: CB | last post by:
Using C# in .Net 2003, DataSet.ReadXml fails when a percentage (%) sign is in the filename followed by 2 hex characters. Seems that the % sign is likely encoding the following 2 hex characters. ...
5
by: James Morton | last post by:
I have a Static DataSet in a class file that I am using globally between a few forms. The main form populates the dataset through a menu option which invokes ReadXML in the class file to populate...
3
by: Raj Chudasama | last post by:
I am trying to read an xml file and have it view data in the datagrid. (For example take the xml file viewer in the visual studio, when u open an xml file it has that nice readable grid). I...
2
by: C Glenn | last post by:
I'm attempting to use ReadXml. It's working in that I end up with some data in the DataSet. But I'm not able to deal with it effectively after that. The XML file is properly formatted in that it...
2
by: Jason Huang | last post by:
Hi, In my C# Windows Form project, I'm testing comparing using the SqlClient with the ReadXML method. The ReadXML method will read 2 .xml files, one is 4K, the other one is 3Mb, both are on my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
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...

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.