Hi I am not able to attach the file. SO I am pasting the XML data
here.
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<Table>
<COLUMN_ONE_x00A0_>R01AH0030D </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>O65LKDIAM </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>INDLKSIAMO65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01AH1101 </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>U65LKDIAM </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>PPOLKDIAMU65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01AS0269 </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>U65NR </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>PPONRU65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01AS0069 </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>U65NR </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>THPNRU65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01AS0019D </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>O65LKD </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>INDLKDMSPO65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01AS0011D </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>O65NR </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>INDNRO65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01AS0075D </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>O65NR </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>INDNRO65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01AS0076D </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>O65NR </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>INDNRO65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01AS0011 </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>U65NR </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>INDNRU65 </COLUMN_FOUR_x00A0_>
</Table>
<Table>
<COLUMN_ONE_x00A0_>R01BH0030D </COLUMN_ONE_x00A0_>
<COLUMN_TWO_x00A0_>Z5M136354 </COLUMN_TWO_x00A0_>
<COLUMN_THREE_x00A0_>O65LKDIAM </COLUMN_THREE_x00A0_>
<COLUMN_FOUR_x00A0_>INDLKSIAMO65 </COLUMN_FOUR_x00A0_>
</Table>
</NewDataSet>
I don't have any idea why it is appending _x00A0_ .
Thanks
Use DataSet.WriteXml method to create a file of serialized dataset and
send
it to me (or attach it to your reply).
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & developmentwww.rthand.com
Blog:
http://cs.rthand.com/blogs/blog_with_righthand/
It returns the same error. Is there anything to do with
GetOleDbSchemaTable ?
Pls advise.
On Mar 26, 11:34 am, "Miha Markic [MVP C#]" <miha at rthand com>
wrote:
Try putting column name into square brackets, like myView.Sort =
"[COLUMN_ONE ]"
Hi Miha Markic, Thanks for your response. Here is the code that
loads
the table.
Dim DSExcel As DataSet
Dim strSelect As String
strSelect = "Select from [" & strSheetName & "$]"
Dim objCmd As New OleDb.OleDbCommand(strSelect, Conn)
Dim daExcel As New OleDb.OleDbDataAdapter
daExcel.SelectCommand = objCmd
daExcel.Fill(DSExcel)
Dim DSExcel1 As DataSet
DSExcel1 = New DataSet
Dim myView As New DataView
myView = DSExcel.Tables(0).DefaultView
myView.Sort = "COLUMN_ONE "
NOTE: I debugged and checked the values of
DSExcel.Tables(0).Columns(0).ColumnName,
myView.Tables(0).Columns(0).ColumnName . both are "COLUMN_ONE "
In fact "COLUMN_ONE " is the name of first column in the spreadsheed
that I was uploading. In the quickwatch I saw there is a space
character at the end "COLUMN_ONE "
Please advise.
On Mar 26, 10:14 am, "Miha Markic [MVP C#]" <miha at rthand com>
wrote:
I guess the table you are assuming to be at position 0 is not
there.
Why don't you try to look into its columns in debugger?
How do you load the table?
Hi, I was trying tosortdataviewusing the below process. It is
throwing exception. Please help.
Dim DSExcel1 As DataSet
DSExcel1 = New DataSet
Dim myView AsDataView
myView = DSExcel.Tables(0).DefaultView
myView.Sort= "Column_One"
DSExcel is a dataset with one table and 8 columns.
NOTE: "Column_One" is DSExcel.Tables(0).Columns(0).ColumnName
In the exception it says : Message "Cannot find
columnColumn_One."
String