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