Click here to Skip to main content
14,241,668 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi All,

I am using a DataTable in my application with Linq for insertion, updation and Deletion. I have used the nos. and name of column same as in Database.

I want to convert this DataTable into Generic List and then Insert all record in Database with InsertAllonSubmit.

So Please let me know the way Convert DataTable to Generic List or any another way to insert DataTable into Database with single trip without using SqlBulkCopy.

Regards!
Aman
Posted
Updated 14-Mar-11 0:45am
v2
Rate this:
Please Sign up or sign in to vote.

Solution 1

LinQ Data Context has a SubmitChanges() which updates all changes in the data context objects.

Create new objects, then add it to the Data context collections. Finally call the SubmitChanges function

Is that function doesn't helps?

If you want to know more about this function, have a look at here.

http://weblogs.asp.net/scottgu/archive/2007/07/11/linq-to-sql-part-4-updating-our-database.aspx[^]
   
Comments
Aman4.net 14-Mar-11 7:40am
   
Thanx for your reply...
Rate this:
Please Sign up or sign in to vote.

Solution 2

   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100