Home All Groups Group Topic Archive Search About
Author
28 Jun 2005 12:36 PM
Nikolay Petrov
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

Author
28 Jun 2005 3:33 PM
Chris
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
Author
28 Jun 2005 8:01 PM
Nikolay Petrov
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)
Author
29 Jun 2005 12:59 AM
Ken Tucker [MVP]
Hi,

            Try adding some data to dr.

Ken
------------------------
"Nikolay Petrov" <johnt***@mail.bg> wrote in message
news:1119988887.910094.197370@f14g2000cwb.googlegroups.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)
Author
29 Jun 2005 5:30 AM
Nikolay Petrov
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.
Author
29 Jun 2005 6:02 AM
Cor Ligthert
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.info/default.aspx?ID=88584022-3c90-4dcb-baa3-c08393f16ce9

I hope this helps,

Cor
Author
29 Jun 2005 8:05 AM
Nikolay Petrov
Add throws an exeption that the row belongs to onother table?
Author
29 Jun 2005 9:15 AM
Cor Ligthert
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
Author
29 Jun 2005 12:33 PM
Nikolay Petrov
thanks cor