Excute reader is to easy and quickly fetch the data from
database. but in some casse excute non query is more useful
than excute query , excute reader and excute scalar
thanks
Wrong Question , As ExceuteReader(),ExecuteNonQuery() and
ExecuteScaler() interact to database in same manner and we
all Know about the ExceuteReader(),ExecuteNonQuery() and
ExecuteScaler() serves for different purpose , as
ExceuteReader() reads data against select query ,
ExecuteScaler() reads single cell value and
ExecuteNonQuery() used for action query not returns any
result set.
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!
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
What combination of methods are used to improve the speed of
the fill() method of the DataAdapter?
a) BeginFillData() and EndFillData()
b) StartFillData() and EndFillData()
c) BeginLoadData() and EndLoadData()
d) StartLoadData() and EndLoadData()
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.
When an ASP.NET server control is added to a web form,
Visual Studio .NET adds one item to the class for the form.
What item is added?
a) The event registration.
b) A protected class member for the control.
c) A default event handler for the click event.
d) A default class that inherits from the control?s base class.