473,661 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with ReadXML file path. please help

3 New Member
Hi, I'm using VB.net 2005.

My dataset is called DsDetails1
My XML file is called details.xml

When I use ReadXML, is there any way that I can set the path of this XML file to be read to be the root of my VB sollution. I need to be able to move the project around to different computers while coding, and I do not want to change the connection string every time.

tried:
Expand|Select|Wrap|Line Numbers
  1. DsDetails1.ReadXml("|DataDirectory|\Details.xml")
as with a database, but that didn't work.

Is there anything similar that I can do? Please help!
Aug 3 '07 #1
1 1450
BlouHond
3 New Member
Hi - just found my answer in the MDSN forums.

In case anyone else would like to know the answer:
I put my details.xml file in the bin\debug folder of the sollution and use the following code:

Expand|Select|Wrap|Line Numbers
  1. DsDetails1.ReadXML(Application.StartupPath + "\\details.xml")
Aug 3 '07 #2

Sign in to post your reply or Sign up for a free account.

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 files/datatables... Should I use the IO.Stream? The XmlReader/XmlWriter?
2
1810
by: bfrasca | last post by:
I have a well-formed XML file that I am trying to load into a dataset using the ReadXML method. It keeps telling me that "there are multiple root elements". I can view the data using XML Designer in Visual Studio 2003 without any problems and the schema and file have been validated using several different tools. I even successfully generated a typed dataset with Visual Studio 2003 by importing the XML into my project. I'm baffled, does...
2
10130
by: Reshma Prabhu | last post by:
hello, I am trying to do an xsl tranformation from an XML file into another xml file. I want the output file to be in MemoryStream so that my dataset can direclty read xml using dataset.ReadXml(memoryStream). But at the time of reading it gives following exception System.Xml.XmlException: The root element is missing. But if i write into a file and then read dataset from that then it works fine.
0
1564
by: serge | last post by:
I have an XML file with an XSD file. When i am reading the XML file and putting its content into a DataSet I notice that the field that has a single space character is being converted to a field with no space character. DataSet ds = new DataSet(); ds.ReadXmlSchema(Path.ChangeExtension(fileNameC , ".xsd")); ds.ReadXml(fileNameC, XmlReadMode.ReadSchema);
3
2398
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 need help only with adding the data to the datagrid. this is what i have so far. I have created...
8
2373
by: Thirsty Traveler | last post by:
I have a dataset that is returned from a sql server select that contains metadata and a cached dataset saved in an xml column. I would like to recover the dataset for use in generating a crystal pdf file. the rptds.ReadXml method can accept either a string file indicating a filename or a stream. the row.ToString() is the saved dataset. If I use this directly it throws an error because it is data and not a filename. I have a workaround seen...
1
1484
by: Ryan Ramsey | last post by:
I currently have this code: string filePath = "c:\\results.xml" PlayersDataSet.ReadXml(filePath); and it works fine, it reads the local xml file into a dataset... If I change the filePath to a readable source on a remote server: string filePath = http://finao.net/results.xml; PlayersDataSet.ReadXml(filePath);
10
14112
by: webmaster | last post by:
Getting error: Illegal characters in path what's wrong with this? string xmlSR = "<XmlDS><table1><phone>Value1</phone><name>jake</name></table1></XmlDS>"; myDataSet.ReadXml(xmlSR, XmlReadMode.IgnoreSchema); DataList5.DataSource = myDataSet; DataList5.DataBind(); Also, what's the best way to return XML from a method for binding into
13
1621
by: slinky | last post by:
I'm working on a problem with a form with 6 textboxes and a submit button for adding data to an Access database.I changed a few things and got it down to 1 error!. I have a Sub Page_Load and a Sub btnAdd: (It still doesn't like the 'SourceVersion' in the Sub Page_Load). Also I viewed the .aspx in the browser and got an error which I posted complete at the bottom of this post). Thanks for any clues... I'm almost there!!
0
8343
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8855
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
8758
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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...
1
6185
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
5653
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
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.