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

Import DataRow

I have a problem with importing a row in datatable.
When using the Table.ImportRow, the row isn't imported.
Why?
I've checked the rows count and it doesn't increase.
no exeptions are thrown

Nov 21 '05 #1
8 4002
Nikolay Petrov wrote:
I have a problem with importing a row in datatable.
When using the Table.ImportRow, the row isn't imported.
Why?
I've checked the rows count and it doesn't increase.
no exeptions are thrown


Maybe some code would help us help you.

Chris
Nov 21 '05 #2
I've got a typed dataset DS with a table in it
dim dr as datarow
dr=DS.Tables(0).NewRow
'Code to set the idems of the row
dim DS2 as dataset
ds2=ds1.clone
ds2.tables(0).ImportRow(dr)

Nov 21 '05 #3
Hi,

Try adding some data to dr.

Ken
------------------------
"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I've got a typed dataset DS with a table in it
dim dr as datarow
dr=DS.Tables(0).NewRow
'Code to set the idems of the row
dim DS2 as dataset
ds2=ds1.clone
ds2.tables(0).ImportRow(dr)
Nov 21 '05 #4
There is data, i've just skipped it here in the example.
I can see the data in the debug window.
It is there, but the row is not imported at all.

Nov 21 '05 #5
Nikolay,

As Ken don't I see why you use the importrow. I don't know if this affect
it, however your row has AFAIK not even a rowstate. Add would work in this
case and set with that the rowstate to Added.

See here a sample of using ImportRow on our site.

http://www.windowsformsdatagridhelp....3-c08393f16ce9

I hope this helps,

Cor
Nov 21 '05 #6
Add throws an exeption that the row belongs to onother table?

Nov 21 '05 #7
Nikolay,

Add throws an exeption that the row belongs to onother table?


Give next time direct this kind of information. Than we see it probably
mostly direct.

\\\\
dim dr as datarow
'Code to set the idems of the row
dim DS2 as dataset
ds2=ds.clone
dr=DS2.Tables(0).NewRow
ds2.tables(0).Add(dr)
///
I hope this helps,

Cor
Nov 21 '05 #8
thanks cor

Nov 21 '05 #9

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

Similar topics

2
by: Eric Caron | last post by:
Hi I try to import file in a dataset. How I can do this ?
11
by: Thomas Lischetzki | last post by:
Hello all together, I have a little problem importing the following xml file into a dataset. <?xml version="1.0" standalone="yes"?> <logfile version = "0.1.001" > <log date = "01.01.2005"...
10
by: Washington | last post by:
How I can import new data form table in existing one. The tables are same, for e.g. Table 1 ID | FirstName | Last Name Table 2 ID | FirstName | Last Name Only data are different.
6
by: JIM.H. | last post by:
Hello I have; DataRow dr= dataSet11.myTable.NewRow(); And I am filling the fields of this datarow. Now I need to create a copy of this row as drCopy and change a few fields and add both to...
6
by: darrel | last post by:
is that doable? I have built a CSV string using a stringbuilder. I now want to take this data and populate a DS. How do I do that? I've gotten this far:
4
by: hharry | last post by:
hello all, i have 2 datatables and am trying to transfer rows from datatable a to datatable b i use the datatable.importrow method. the importrow method fails (but does not throw an...
10
by: mcbobin | last post by:
Hi, Here's hoping someone can help... I'm using a stored procedure to return a single row of data ie a DataRow e.g. public static DataRow GetManualDailySplits(string prmLocationID, string
0
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I am using ImportRow to get selected rows from a DataTable and add them to a new table. The code looks something like this: DataTable dtTemp = new DataTable(); foreach(DataRow drOld in...
5
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it...
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: 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
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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,...

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.