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

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

authentication - ASP.NET Core 1.0. Bearer Token, cannot access custom claims -