473,395 Members | 1,863 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,395 software developers and data experts.

adding datarows to tables and datatables to datasets

psb
I thought this was weird?? is this a bug in framework 1.0??? (1.0 is the
version I am running against)

---------------------------
dim dtAll as new datatable
dim dtTmp as datatable
dtTmp = LoadDataTable("select top 100 from table...")
for i=0 to dtTmp.rows.count -1
''''ERROR ON THIS LINE'''
dtAll.Rows.Add(dtTmp.rows(i))
next
-------------------------------
ERROR: Datarow already belongs to another datatable

I get the same error with adding datatables to datasets althought it says
"this table belongs to another dataset"
---------------------------------------
dim MyDataSet as New Dataset
dim dtTmp as datatable
dtTmp = LoadDataTable("select top 100 from table...")
MyDataSet.Tables.Add(dtTmp)
--------------------------------------------

Thanks,
~psb
Nov 18 '05 #1
1 880
This is not an error. A DataRow may only belong to one DataTable at a time.
The same with a DataTable. A DataTable may only belong to one DataSet at a
time.

-Cliff

"psb" <pb******@msn.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I thought this was weird?? is this a bug in framework 1.0??? (1.0 is the
version I am running against)

---------------------------
dim dtAll as new datatable
dim dtTmp as datatable
dtTmp = LoadDataTable("select top 100 from table...")
for i=0 to dtTmp.rows.count -1
''''ERROR ON THIS LINE'''
dtAll.Rows.Add(dtTmp.rows(i))
next
-------------------------------
ERROR: Datarow already belongs to another datatable

I get the same error with adding datatables to datasets althought it says
"this table belongs to another dataset"
---------------------------------------
dim MyDataSet as New Dataset
dim dtTmp as datatable
dtTmp = LoadDataTable("select top 100 from table...")
MyDataSet.Tables.Add(dtTmp)
--------------------------------------------

Thanks,
~psb

Nov 18 '05 #2

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

Similar topics

0
by: Uchiha Jax | last post by:
I have used this method many a time in previous applications without any hitches at all and i'm trying to use it in my current application and it isn't working. The only difference I can see is...
1
by: psb | last post by:
I thought this was weird?? is this a bug in framework 1.0??? (1.0 is the version I am running against) --------------------------- dim dtAll as new datatable dim dtTmp as datatable dtTmp =...
3
by: Yul | last post by:
Hi, We are in the process of designing an ASP.NET app, where a user will enter some 'Customer ID' to be queried in the database. If the ID is valid, several stored procedures will be called to...
16
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
5
by: Richard Fagen | last post by:
Hi Everyone, I have been writing xBase applications for many years but I am new to VB/SQL for larger applications. In xBase, I would start the main program (form) by opening up all the...
5
by: M Harris | last post by:
We are developing an application (using .Net in MS Studio 2003 using the Access jet engine as a backend) that is doing quite a bit of number crunching. The first part of the application was...
3
by: creator_bob | last post by:
How do I create an array of datarows from a sorted list? I put a bunch of datarows into a sorted list to sort them. Then I got an array of the sorted elements. However, I cannot typecast them. ...
3
by: sonymathur | last post by:
I'm using two datasets DS1 & DS2 (both hold data with same schema) in VB.Net 1.1 DS1 is main datasets and DS2 is like subset to DS1.Now how should i remove datarows from DS1 that are like in DS2....
8
by: jehugaleahsa | last post by:
Hello: We wrote an entire application where we add our DataRows to our DataTables immediately. However, we have to shut off our constraints to do this. We would like to use detached DataRows to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.