which one is faster execute reader, scalar, execute non
query ?

Answer Posted / peter

What is faster:

ExecuteNonQuery("INSERT INTO...; INSERT INTO...; INSERT
INTO");

or

ExecuteNonQuery("INSERT INTO...")
ExecuteNonQuery("INSERT INTO...")
ExecuteNonQuery("INSERT INTO...")

I hope you see my point. Of course it is not a matter of
only three inserts, but maybe 200 - and then I would like
to know if I can save time by adding the INSERT-strings to
one big string and only fire off one ExecuteNonQuery.

I was thinking of coding a test to check, but if some of
you have already done this or just know which is faster,
please let me know.

Thanks

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How should I destroy my objects in asp.net?

606


How can you identify that the page is post back?

564


How can you display all validation messages in one control?

557


What is server transfer?

503


How do you hide the columns?

593






What is state management react?

519


what are the web form events available in asp.net?

568


Explain the difference between web user control and web custom control?

542


What is the difference between response.redirect and server.transfer?

545


What is bson in web api?

597


Explain about the Class view window?

596


What is the difference between exe and dll?

561


What is diff. Between abstract class and an interface?

526


How can we add an event handler for a ASP.NET function executed on MouseOver for a certain button.

625


What does the .webpart file do?

595