Jeff
Jeff

Reputation: 1649

Insert multiple DB rows from listview - VB.NET MYSQL

I have a listview that can contain up to roughly 2,000 listview items I need to loop through the listview and insert each item into a mysql database

is there a better, bulk way, to insert the data instead of doing an insert for each item like follows:

for each itm ...
  insert into whatever ( id ) values ( itm.text ) ...
next

Thanks

Upvotes: 0

Views: 1673

Answers (1)

ipr101
ipr101

Reputation: 24236

You could build up a file containing the changes and then use the 'LOAD DATA INFILE' functionality -

http://dev.mysql.com/doc/refman/5.0/en/load-data.html

Upvotes: 1

Related Questions