how can I create a copy of a DataRow that lasts after datatable is cleared?
If I have just filled a DataTable in a typed DataSet with a single
row, is there a way I can make a copy of that row, so that I can clear
the DataTable in that DataSet and use it for another query, but my
copy of the row will be preserved?
If I try to do something like this:
"SELECT * FROM wbuser where username='bennett';";
dsLocalDataSet.wbuserRow currRow = ds1.wbuser;
"SELECT * FROM wbuser where username='bennett2';";
// this won't work; reference to currRow is no longer valid
(where dsLocalDataSet is a typed DataSet class containing a table
called "wbuser") then this won't work, because currRow just refers to
row zero of the ds1.wbuser DataTable, and when I call ds1.Clear(),
On the other hand DataRow doesn't appear to have a built-in method for
making a copy of itself. The ds1.wbuser DataTable class does have a
member method called NewwbuserRow() generated for it, but it doesn't
take any arguments, so I can't pass an existing wbuser row to it and
make a copy. Is there some way to make a copy that I can refer to
later in the code, even after I've cleared out the dataset object and
reused it for another query? Or do I have to use a different dataset
object for every query, if I want to keep the row objects around so
that I can refer to them later in the code?
|All times are GMT. The time now is 01:50 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.