ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
What is the difference between ExecuteReader,ExecuteNonQuery
and ExecuteScalar.
 Question Submitted By :: Senorsrini
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between ExecuteReader,ExecuteNonQuery and ExecuteScalar.
Answer
# 1
ExecuteReader - This method returns a DataReader which is
filled with the data that is retrieved using the command
object. 

ExecuteNonQuery - This method returns no data at all. It is
used majorly with Inserts and Updates of tables. 

ExecuteScalar - Returns only one value after execution of
the query. It returns the first field in the first row. 

This would be excellent for receiving a count of records
(Select Count(*)) in an sql statement, or for any query
where only one specific field in one column is required.
 
Is This Answer Correct ?    6 Yes 2 No
Jerry Joseph
 
  Re: What is the difference between ExecuteReader,ExecuteNonQuery and ExecuteScalar.
Answer
# 2
Execute Reader: it executes the command and returns the result 
set of the command

Execute NonQuery: it executes the command and returns the
number of rows affected

Execute Scalar: it executes the command and returns only
first row first column value
 
Is This Answer Correct ?    9 Yes 3 No
Rajesh
 
 
 
  Re: What is the difference between ExecuteReader,ExecuteNonQuery and ExecuteScalar.
Answer
# 3
ExecuteReader-It is readonly forward only.It executes the 
command and return the reader objectl.It executes only 
select command.

ExecuteNonQuery-It executes command and return's no 
value.It returns only how many row effected.It returns 
value when the commandType is stroedProcedure with output 
parameter.

ExecuteScalar-It executes the command and return a single 
value.That is 1st column and 1st row.
 
Is This Answer Correct ?    4 Yes 1 No
Surya Narayana Panda
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
When Garbage Collector will run and how its identifing whether the Object is used or Not.? Verizon2
How many web.config files in each solution General-Mills9
What is X-Path? Sherston2
which one is faster execute reader, scalar, execute non query ? Minecode16
What method must be overridden in a custom control? a) The Paint() method b) The Control_Build() method c) The Render() method d) The default constructor Syntax-Softtech1
1. Briefly describe your ideal job? Swatz-Oils1
Describe the two main components of the .NET framework ?  1
# What is the transport protocol you use to call a Web service?  1
Difference between ByVal and ByRef? Microsoft2
One Listbox showing all cities. If you select one city in list box the information related to that particular city should be displayed in Datagrid . How do you do that? HCL3
What data types do the RangeValidator control support?  2
Write a code for "RequiredFieldValidator" in java script Wipro3
When maintaining session through Sql server, what is the impact of Read and Write operation on Session objects? will performance degrade..  2
code for inserting images into gridview colomns from database HP3
what is stateless ?  2
What is difference between masterpage and user control, what is the objective of master page when we had user control in .NET 1.1 version DELL3
To which class you load XML or Related Data  1
Explain Factory pattern? Microsoft1
Where do you store the information about the user?s locale?  1
Which method do you invoke on the DataAdapter control to load your generated dataset with data?  1
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com