Click here to Skip to main content
15,896,726 members
Articles / Database Development / SQL Server

Using SQL bulk copy with your LINQ-to-SQL datacontext

Rate me:
Please Sign up or sign in to vote.
4.96/5 (18 votes)
25 Jan 2012CPOL 92.6K   29  
How to use bulk insert with your LINQ-to-SQL datacontext

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
23 Feb 2012RupertC
If the order of your columns is different in the LINQ to SQL class from that in the database, then you also need to add a column mapping to the bulk copier. Otherwise you get mysterious errors in some of the loaded columns!In my simple fix, I assume that the names match even if the order may...

License

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


Written By
Software Developer (Senior) Tånneryd IT AB
Sweden Sweden
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions