datatable - Adding a row to a dataset C# -


i have code this:

datarow[] drmyrow = mydataset.tables[0].select("columnname=" + smth );                                 if (drmyrow .length == 0)                                 {                                     datarow dr = mydataset.tables[0].newrow();                                     dr["columnname"] = smth ;                                     mydataset.tables[0].rows.add(dr);                                 } drmyrow = mydataset.tables[0].select("columnname=" + smth ); 

in debug mode see new added row using dataset visualizer. when run line again;

drmyrow = mydataset.tables[0].select("columnname=" + smth ); 

drmyrow.length shows 0 again. tried getchanges() or acceptchanges() not working. there solution, mistake ?


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -