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

Answers were Sorted based on User's Feedback



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

Answer / satish v itagi

ExecuteNonQuery is used to inserts, updates, deletes.
ExecuteScaler is used to return values at a stretch; and
can do data modifications too.
ExecuteReader is forward only reading of row by row.

The number of readers that can be open at a time has
limitation (255)

Execute Scaler has no such restriction. You can use
sqlparameters (output) to get more than one field value,
you can use multiple queries to get more than one result.

Because of less overheads, ExecuteReader has a slight
performance advantage but has limitations.

Do not forget to close Readers!

Is This Answer Correct ?    4 Yes 1 No

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

Answer / kriss

Execue reader

Is This Answer Correct ?    2 Yes 0 No

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

Answer / anirudh g

Scalar will be faster that the execute reader and execute
non query. As scalar only fetch one column single row.
Whereas execute reader may return numbers of record and
though non-query will not return any records it will take
time to identify the data types to validate be4 inserting
the data

Is This Answer Correct ?    2 Yes 0 No

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

Answer / kamlesh sharma

most of the above answers are wrong

write answer is execute reader

Is This Answer Correct ?    5 Yes 4 No

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

Answer / xc v

execute reader

Is This Answer Correct ?    1 Yes 0 No

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

Answer / 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

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

Answer / ftryttuyhg

execute non query

Is This Answer Correct ?    3 Yes 4 No

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

Answer / ranjitha

Execute Non query

Is This Answer Correct ?    10 Yes 24 No

Post New Answer

More ASP.NET Interview Questions

How to manage different kinds of sessions in ASP.NET?

0 Answers   Cap Gemini,


Is string a value type or a reference type?

13 Answers  


What is difference between web api and web services?

0 Answers  


In ViewState How much lifespan items stored?

0 Answers   Siebel,


How does the XmlSerializer work? What ACL permissions does a process using it require?

2 Answers  






When would you not use the oleDbConnection object? a) To connect to an SQL 7.0 database. b) To connect to a DB/2 database. c) To connect to an Access database. d) To connect to an SQL 6.5 database.

6 Answers   Syntax Softtech,


What is difference in .net 1.1 and .net 2.0?

0 Answers  


i want to develope a page for online test using asp.net with c#.net. so, how to insert the questions in the database sqlserver2000 and how to pick the questions randomly when user login for test. plz send the code for this....

3 Answers   Chaitanya, Crysalis, CTS, HCL, Sein Infotech, TCS,


What are the action filters available in asp.net mvc

1 Answers   TCS,


what is webservices. howit is use in our project .

1 Answers   Patni,


What is %20 in a url?

0 Answers  


Can we set master page as a start page?

0 Answers  


Categories