Hi,
I want to copy datarow from one table & then insert into another table, but i am having some problems with this.
I don't know what is the correct way to do this? I tried the import row method but it gives an exception.
Thanks for the help.
Hi,
I want to copy datarow from one table & then insert into another table, but i am having some problems with this.
I don't know what is the correct way to do this? I tried the import row method but it gives an exception.
Thanks for the help.
Hey you can do this by using the ItemArray property, and then attaching the new row to the destination table via InsertAt.
I hope this helps you!
Thanks Ettan!
I tried using ItemArray property but it gives me an the datarow at the last record but not on the position where i want it to be shown.
What could be the problem?
Hi,
Why don't you use dataview with properties set instead of datagrid?
I think this will solve your problem.
HI, you can try the follow to copy a datarow to anothher table:
First, copy the schema of the table you want to copy, to the new table
dim newTable as new dataTable
newtable=originalTable.Clone
after that, using ImportRow you can copy the rows you want
For n As Integer = 0 To originalTable.Rows.Count - 1
newtable.ImportRow(originalTable.Rows(n))
Next
hope it helps you!! it's the best way
Bookmarks