Working with SqlBulkCopy can sometimes be a struggle. Sure, if you happen to get the data from a table that is identical to the one you want to push to, you are in luck. If not, you need to be sure that the DataTable object is exactly like the target table in the SQL database you want to import data to. One type wrong, or one column in the wrong place, and you are out of luck… it won’t work.

This function can save you some frustration. It will connect to an already existing table and create an empty DataTable ready to fill with data! Nice, eh?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s