How to save a datarow into dataset??

G

Guest

Hi

I wanna save changes made to dataset liker adding a datarow by dr=ds.tables(0).newrow and then setting thev value for each column of the table. But I couldn't save those to dataset and eventually to Original database (Like SQL,Excel etc.

Please help
 
N

Nico Debeuckelaere

Did you also put the ds.tables(0).AddRow(dr) statement after filling the
datarow?

Regards,

--

Nico Debeuckelaere

ND-Sign BVBA (Microsoft Certified Partner since 2004)
URL: http://www.nd-sign.com
== ND-Sign, Designed for you ==
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Shalin said:
Hi,

I wanna save changes made to dataset liker adding a datarow by
dr=ds.tables(0).newrow and then setting thev value for each column of the
table. But I couldn't save those to dataset and eventually to Original
database (Like SQL,Excel etc.)
 
G

Guest

Sorry

I can't find AddRow() fn in DataSet class. It's not there. Here ds is my dataset

Help..
 
C

Cor

Hi Shalin,

A dataset is an object that have references to datatables, which have
references to rows which contains items

(Or writing simpler)

A dataset contains tables which contains rows which contains items

ds.tables(x).rows(y).item(z)

Is an item in a row in a datatable in a dataset.

To add a row you can do
dim dr as datarow = ds.tables(x).newrow
ds.tables(x).rows.add(dr)

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top