Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to add data to database

Status
Not open for further replies.

saintedmunds

Technical User
Apr 7, 2006
78
GB
HI

I have an app that sends out bulk emails from my Database.
So it loops round sending the email and it either succedded or failed.
Now I want to record this info in a database lets say table name EmailCampaignResults FieldNames ContactID CampaignID and Succedded(Bit/True 0r False) now i can do the insert etc but when is best to do this?
If i do it after each send I have to open the database add the data close the database then go on to the next one this seems a very slow and longwinded way.
Would it be better to store the data in an Array or Dataset and then add this to the database after all the sending is complete?

What do you think would be best?

Cheers
 
Thank you for the quick reply.

So would I load my data into a datatable in the loop and the use the sqlBulkCopy to updata the database?

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top