Quantcast
Channel: How should I multiple insert multiple records? - Stack Overflow
Viewing all articles
Browse latest Browse all 12

Answer by Tim Schmelter for How should I multiple insert multiple records?

$
0
0

You should execute the command on every loop instead of building a huge command Text(btw,StringBuilder is made for this)The underlying Connection will not close and re-open for each loop, let the connection pool manager handle this. Have a look at this link for further informations: Tuning Up ADO.NET Connection Pooling in ASP.NET Applications

If you want to ensure that every command is executed successfully you can use a Transaction and Rollback if needed,


Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>