c# - Assign values to dataset object -


i have values want assign dataset tried below didn't worked.

string strexp = ""; (int = 0; < ds.tables[0].rows.count; i++) {     strexp = "raname = '" + ds.tables[0].rows[i]["raname"].tostring() + "'";     datarow[]  dr=  ds.tables[0].select(strexp); } dataset dsnew = new system.data.dataset(); dsnew = ds.tables[0].select(strexp); 

kindly let me know how assign values dataset

you did not call acceptchanges:

string strexp = "";             (int = 0; < ds.tables[0].rows.count; i++)             {                 strexp = "raname = '" + ds.tables[0].rows[i]["raname"].tostring() + "'";                 datarow[]  dr=  ds.tables[0].select(strexp);             }             ds.tables[0].acceptchanges(); //commits changes made table since last time acceptchanges called.             datatable dtnew = ds.tables[0].select(strexp).copytodatatable();             dataset dsnew = new system.data.dataset();             dsnew.tables.add(dtnew); 

the value got stored in datatable select queries committed version of datatable.


Comments

Popular posts from this blog

Combining PHP Registration and Login into one class with multiple functions in one PHP file -

Android volley - avoid multiple requests of the same kind to the server? -

magento2 - Magento 2 admin grid add filter to collection -