"=?Utf-8?B?Q2hyaXM=?=" <> wrote in
news:0162342D-15B9-464B-8A3E-:
> I am trying to load 3 xml files into one dataset like
>
> dsXML.ReadXml(Server.MapPath("file1.xml")
> dsXML.ReadXml(Server.MapPath("file2.xml"))
> dsXML.ReadXml(Server.MapPath("file3.xml"))
>
> I am then trying to display each files in separate datagrid
>
> datagrid1.datasource = dsXml.tables(0)
> datagrid1.datasource = dsxml.databind
>
> datagrid2.datasource = dsXml.tables(1).columns(1).toString
> datagrid2.datasource = dsxml.databind
>
> datagrid3.datasource = dsXml.tables(2).columns(1).toString
> datagrid3.datasource = dsxml.databind
>
> I am getting the error
>
> Cannot find table 1.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
>
> Exception Details: System.IndexOutOfRangeException: Cannot find table
> 1.
I think you're getting this error because ReadXML only creates 1 Dataset
based on one XML file. It won't create multiple tables for you. You'll
need to explicitly load each table.
--
Lucas Tam ()
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/