remove rows from dataset1 & add those to dataset 2 C# -


i have 2 datasets, instances dataset1 & dataset2 same structure. need query dataset1, result, remove rows dataset1 & insert rows dataset2. how ?

assuming have condition ready (e.g. id == 8), easy using linq:

var records = dataset1.where(d => d.id == 8); dataset1.remove(d => d.id == 8); foreach (var r in records)     dataset2.add(r); 

Comments

Popular posts from this blog

javascript - How do you prevent nested queries/catches in sequelize? -

java - Could not retrieve pre-bound Hibernate session - Could not obtain transaction-synchronized Session for current thread -

ruby on rails - ActiveRecord order not working -