How to insert bulk data into mysql table from asp.net at once.

Posted by kranthi on Stack Overflow See other posts from Stack Overflow or by kranthi
Published on 2010-06-01T08:24:45Z Indexed on 2010/06/02 1:33 UTC
Read the original article Hit count: 290

Filed under:
|
|
|

Hi,

I have a requirement that I need to read an excel sheet using asp.net/C# and insert all the records into mysql table.The excel sheet consists of around 2000 rows and 50 columns. Currently,upon reading the excel records ,I am inserting the records one by one using a prepare statement into mysql table.But its taking around 70 secs to do so because of the huge data.

I've also thought of creating a new datarow, assigning values to each cell,adding the resulting datarow to datatable and finally calling dataadapter.update(...).But it seems to be complex because I got around 50 columns and hence I'll have to assign 50 values to the datarow.

Could someone please suggest if there is an alternate to improve the performance of the insertion?

Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mysql