Sign in | Join
Last post 11-02-2009 5:31 AM by preeja.preeja. 4 replies.
Sort Posts: Oldest to newest Newest to oldest
Hi all,
I am developing one application where I have 1000 records to insert into MySQL Database . Is it possible to insert using one connection ? I have no idea how to accomplish it.. Can anyone suggest piece of code to run multiple queries at a time?
I appreciate your help.
Refer SQLBulkCopy, or you can use xml to transfer data from .net to sql
INSERT INTO <table> (<col1>, <col2>...)
VALUES
(<val1 for col1>, val1 for col2>...),
(<val2 for col1>,<val2 for col2>...)...;
Check this: http://www.brainbell.com/tutorials/MySQL/Inserting_Multiple_Rows.htm
i agree with sqlbulkcopy. But sqbulk copy is tranfer with sql server..For MySQL just check the fowllowing. I think that may help you..
http://forums.asp.net/t/1332814.aspx
If you wan to run multiple queries [successfully] at a time, you can simply do it with SQL transactions.