473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Why are these tables not adding

Hi,
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.

Is this possible.

Thanks
Nov 19 '05 #1
3 1079
"=?Utf-8?B?Q2hyaXM=?=" <Ch***@discussions.microsoft.com> wrote in
news:01**********************************@microsof t.com:
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 (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2
Hi,
Does that mean I need separate datasets?

"Lucas Tam" wrote:
"=?Utf-8?B?Q2hyaXM=?=" <Ch***@discussions.microsoft.com> wrote in
news:01**********************************@microsof t.com:
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 (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 19 '05 #3
"=?Utf-8?B?Q2hyaXM=?=" <Ch***@discussions.microsoft.com> wrote in
news:5A**********************************@microsof t.com:
Hi,
Does that mean I need separate datasets?


Yes, basically your xml only defines one dataset.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Avirneni | last post by:
With my understanding of indexed views and according to books I read "indexed views" are supposed to perform much better than "temp tables" (temp table having primary key and indexed view with...
2
by: Julia Baresch | last post by:
Hi everyone, My database has 3 data tables with chained one-to-many relationships i.e. Table1 1-->Many ->Table2 1-->Many ->Table3 I added a fourth table to hold supplemental data that also...
4
by: Heather | last post by:
I am creating a database with a backend and frontend. The backend consists of a Products table and many other tables. The products table in an .mdb file by itself is over 2 meg. I thought about...
3
by: Michael Thomas | last post by:
Hi everyone Is there any way to compare tables and automatically update values. I import a list of products with associated cost prices and selling prices from an external database into a table...
7
by: Joe | last post by:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource (using Oracle ODBC drivers). After linking the tables in Access, I inspect the data contained in the linked tables. For...
1
by: robert d via AccessMonster.com | last post by:
My application is beginning to interest prospective clients. This may be wishful thinking, but if I have a lot of clients how will I update a production backend when I need to add tables (for...
1
by: Scott | last post by:
Is there a way to add fields to a table from a query? I have a database with back end tables and if I make changes to the front end that include adding extra fields to a table, I have to trust...
59
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy...
1
by: sherifffruitfly | last post by:
Hi all, I'm tasked with adding a few fields to our database, and all of the stuff that goes along with it (updating c# UI code, etc.). The database is a few hundred tables, with all of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.