Problem with format of xml file created from dataset
HI
I have a connection to excel that retrieves data to a dataset.
Its working fine, my problem is organizing the data so that I can record it to the data base.
I’m trying to do it by converting the data to xml, so that I can ask the user to relate the column name (in the excel file) with the correct place in the database.
And parse to the retrieved data.
The code so far is:
Dim cnAs System.Data.OleDb.OleDbConnection
Dim cmdAs System.Data.OleDb.OleDbDataAdapter
Dim dsAsNew System.Data.DataSet()
cn =New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;" & _
"data source=C:\2.XLS;Extended Properties=Excel 8.0;")
' Select the data from Sheet1 of the workbook.
cmd =New System.Data.OleDb.OleDbDataAdapter("select * from [cli$]", cn)
cn.Open()
cmd.Fill(ds)
ds.WriteXml("C:cli.xml")
Im hard coding, so that i can analise the xml file.
My problem is some excel files load to the dataset ok, but creates _x0020 after the name of the column: this one is supposed to appear like <NOME>
<Nome_x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020__x0020_>
So as the data in the dataset is all the same im wondering if the problem is on the creation of the xml. It is strange because some excel files don’t have any problem.
Any ideas?
Thanks

