473,804 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extra Backslash After LoadXML

How do I eliminate an extra backslash that is appearing after LoadXML
call?
This issue is causing an error with Process.Start.

I have a string stored in sql: c:\program files\internet
explorer\iexplo re.exe

If I look at this data when I write the dataset to an XML file, the
data is correct.

After the LoadXML call, the data is hosed.

Notice in my commandlocation node, all of the backslashes are doubled.

I don't know if the problem is in the ds.GetXml() call or the
xd.LoadXml() call.
"<NewDataSe t>
<VendorAction >
<commandlocatio n>c:\\program files\\internet
explorer\\iexpl ore.exe</commandlocation >
<commandargumen ts>http://ServerName/mm/integration/con...x?PatientName=
{PatientName}
</commandargument s>
<commanddescrip tion>Launch SmartID Works Oncology
Product</commanddescript ion>
</VendorAction>
</NewDataSet>"
My code:
//Add the parameter to the Command's Parameters
collection
cmd.Parameters. Add(vaid);

// Create the DataSet & DataAdapter
SqlDataAdapter da = new SqlDataAdapter( );
da.SelectComman d = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "VendorAction") ;

// Write DataSet as XML file
ds.WriteXml(@"C :\VAIDOutput.xm l");
*** Data Correct Here ***
// Load DataSet as XML document to return to caller
xd.LoadXml(ds.G etXml());
conn.Close();
*** Data Error Here ***

If I use double backslashes in the original string in sql:
c:\\program files\\internet explorer\\iexpl ore.exe

then the result from the LoadXml call is quadruple backslashes:
c:\\\\program files\\\\intern et explorer\\\\iex plore.exe

Where and how should this be changed

Nov 14 '06 #1
0 1104

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

Similar topics

10
1738
by: Tank | last post by:
First off let me say that I am by no means a skilled programmer so i probably have made a dozen mistakes in my attempt at coding my problem. I will tell you the problem so that you have an idea of what i am trying to do and I will give you my code so you can see my clusterf*ck. Here is the problem: At work I have about 20 photographers who work for me. Each one has a photo idea number (mine is 102 and my bosses is 101 and my...
1
2067
by: Matt Bush | last post by:
Using .NET Framework 1.1 and Visual Studio .NET 2003. Language is VB.NET. When loading an XML String using XMLDocument.LoadXml we are getting an extra space inserted into abbreviated end tags: objXmlDoc.XmlResolver = Nothing objXmlDoc.LoadXml(XmlData) .... .... objXmlDoc.InnerXml (gets written to database)
6
18768
by: jmgonet | last post by:
Hello everybody, I'm having troubles loading a Xml string encoded in UTF-8. If I try this code: ------------------------------ XmlDocument doc=new XmlDocument(); String s="<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><a>Schönbühl</a>"; doc.LoadXml(s); doc.Save("d:\\temp\\test.xml");
4
2250
by: martin | last post by:
Hi, I am copying an xml file like so. Dim xmlDoc As New XmlDocument xmlDoc.Load("C:\Program Files\Templates\message.msg") Console.WriteLine("Tmaplate loaded") xmlDoc.Save("C:\Program Files\Templates\copy.xml") Console.WriteLine("message saved")
3
2723
by: rasx | last post by:
I get this error when I fail to ‘clean up’ my UTF-8 MemoryStream: “Invalid at the top level of the document. Error processing resource…” Visual Studio 2005 in debug mode shows well formed XML “prepended” with a character represented by an empty rectangle and trailed with a series of backslash zeros (\0). These are the lines of code that solve this problem: s = s.Trim(); s = s.Replace("\0", String.Empty); The Trim() gets...
2
2874
by: binder | last post by:
How do I eliminate an extra backslash that is appearing after LoadXML call? This issue is causing an error with Process.Start. I have a string stored in sql: c:\program files\internet explorer\iexplore.exe If I look at this data when I write the dataset to an XML file, the data is correct.
3
23022
by: Stef Mientki | last post by:
It looks like sometimes a single backslash is replaced by a double backslash, but sometimes it's not ??? See the error message below, the first backslash is somewhere (not explicitly in my code) replaced, but the second is not ??? Is it in general better to use double backslash in filepaths ? thanks, Stef Mientki
2
2188
by: Tobiah | last post by:
>>"'" "'" "'" "\\'" "\\'" This is quite different than any other language that I am used to. Normally, a double backslash takes away the special meaning of the last backslash, and so you are left with a single backslash.
5
15696
by: vlsidesign | last post by:
The printf function returns "warning: unknown escape sequence: \040" for a backslash-space combination. If the ascii decimal number for space is 32 and the backslash is 92, why this particular number 040? Is it a decimal number from the ASCII code chart? (compiling using gcc on SunOS 5.8, Sparc, Ultra-80) Just curious. Thanks.
4
2279
by: Razzbar | last post by:
I'm working on a bookmarklet that grabs information from a page and submits it to a server. Yet another social bookmarking application. I'm having trouble with page titles that include an apostrophe. I'm using encodeURIComponent() around the page title, and again around the URL. Apparently the browser is inserting a backslash before any apostrophe. I can see that when I write the $_GET data to a file in PHP on the server. When the GET...
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9595
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
10600
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
10352
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...
0
10097
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...
0
9175
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5535
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4313
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

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.