473,563 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ReadXml from resources

i saved the state of a data set and table via

MyDs.WriteXmlSc hema("MyDs.xsd" )
MyDs.WriteXml(" MyDs.xml")

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

MyDs.ReadXmlSch ema("MyDs.xsd")
MyDs.ReadXml("M yDs.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.ReadXmlSch ema(My.Resource s.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.D escrip' is not. i was able to read in the text of
'My.Resources.D escrip' into a text box, so the content is there.

how can i make this work?

thanks

ray

Dec 20 '06 #1
1 2373
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.ReadXmlSch ema(new System.IO.Strin gReader(My.Reso urces.Descrip))
My.Ds.ReadXml(n ew System.IO.Strin gReader(My.Reso urces.Info))

Hope this helps

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

MyDs.WriteXmlSc hema("MyDs.xsd" )
MyDs.WriteXml(" MyDs.xml")

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

MyDs.ReadXmlSch ema("MyDs.xsd")
MyDs.ReadXml("M yDs.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.ReadXmlSch ema(My.Resource s.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.D escrip' is not. i was able to read in the text of
'My.Resources.D escrip' 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
408
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 fastest? I don't think the ReadXMLSchema would give a lot of difference, but maybe the overlaods of ReadXml and WriteXml will. Especially with larges...
1
4799
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 should be created in the dataset with the provided xml. However, after the ReadXML statement there are no rows in the DataSet.Tables ? IS there...
1
5811
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
5675
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 I convert data type of one of the column to integer and then I use the Dataset.ReadXml function and pass the same file to it. This works on my...
1
2098
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. So c:\test%ab.xml fails for ReadXml since %ab is interpreted as 171 and c:\test171.xml does not exist. There is no problem with c:\test%mn.xml...
5
2132
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 the DataSet. The ReadXML is a rather lengthy operation with >5mb xml files (I am reading in the schema and ignoreschema on read). This has presented...
3
2393
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 though that when i use the ReadXml funtion it will automatically read data and add the data to the datagrid. but i am wrong its not that simple. so i...
2
4805
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 was created with WriteXML, so it contains the name of the table (I've inspected it to be sure). But after calling ReadXml the DataSet does not...
2
2106
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 PC's local drive. However, I found that it takes approximately 9 seconds for the ReadXML method, while the SqlClient method is about 2 seconds....
0
7580
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7882
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. ...
0
8103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6244
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...
0
3634
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...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
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...

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.