How to use InsertAllOnSubmit in linq?

21 Sep 2012    by: Pradip Kumar Maharana
using (SomeDataContext db = new SomeDataContext()) {

	List<DbItemTableName> dbItemlist = new List<DbItemTableName>();

	DbItemTableName d ;

	foreach(Item i in Items) {

		d= new DbItemTableName();

		d.value = i.value;

		dbItemlist.Add(d);

	}

	db.InsertAllOnSubmit(dbItems);

	db.SubmitChanges();

}

Leave a Reply

Be the First to Comment!

Notify of
avatar