Click to See Complete Forum and Search --> : Append data to a dataset


Goalie35
October 14th, 2005, 11:39 AM
Basically, all I'm trying to find out is whether or not data is able to be appended to a dataset.

In other words, could I initially place 20 rows of data from my database into a dataset and then, after I've successfully retrieved those rows, add an additional 10 rows of data to it or are datasets sort of a 1 time thing?


Thanks in advance.

-Goalie35

poochi
October 14th, 2005, 11:54 AM
You can add data to DataTable at any time.

DataTable has a method called NewRow(). It will return a newly created DataRow object. Set values to it and then call "dataTable.Rows.Add()" method to add it to the DataTable.

You can add a row to DataTable without calling "NewRow()" method(using the another Add(object[]) overloaded method).

Check the DataTable::Rows property and DataRowCollection::Add method for more information.