473,414 Members | 1,618 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,414 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 1564
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. ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.