I'm doing a program in .net, which should bring some Access data and save it in a file, among these data is an XML, which changes the format when saving it in a file. Code to search the XML:
Public Function Buscar_XML()
conecta()
sql = New OleDbCommand("SELECT XML FROM TNR where TNR_NAME='" & Form1.ListBox1.SelectedItem.ToString & "'", cnn)
Reader = sql.ExecuteReader()
Do While (Reader.Read())
Form1.XML = Reader.GetValue(0)
Loop
Reader.Close()
desconectar()
End Function
Create the file:
My.Computer.FileSystem.WriteAllText("C:\TNR\PRUEBA.xml", XML, False)
XML saved in Access (I copy a small fragment as an example)
<body>
<ENVELOPE>
<OP_MSG_TYPE>SO</OP_MSG_TYPE>
<OP_OPERATION>PUBLISH</OP_OPERATION>
And this is what you save in the .xml file:
<div><body></div>
<div> <ENVELOPE></div>
<div> <OP_MSG_TYPE>SO</OP_MSG_TYPE></div>
<div> <OP_OPERATION>PUBLISH</OP_OPERATION></div>
How can I do to take the value as it is in the BD, and why is this happening?
Thank you very much