Welcome! and rules
Joel on Software
Best Way to Insert Data
I'm wondering what's currently best practice for inserting a lot rows into a DB table using ADO.NET. Let's say I have to insert 1000 rows from a client program into a DB table. I know the rows do not exist in the table, so I just want to append them to the table and be done with it.
Do the simplest one. Just create a SqlCommand with the relevant Parameters and have a loop and just change the values and invoke the command for each row. Don't worry about the round-trips - it's incredibly fast.
Thanks, Duncan. That's pretty much the decision I reached, as well. If I eventually run into a problem with the approach, I'll look at the alternatives at that time.
Fog Creek Home