Methods provided by the command object, DOT NET Programming

What are the methods provided by the command object?

The command objects used to connect the connection object to the Datareader or the dataset. The command object provided some methods which are as shown below :-

1)Execute Non Query :- It executes the command defined in the CommandText property against the connection defined in the Connection property for a query which  does not return any row (an UPDATE, DELETE or INSERT). It returns an Integer showing the number of rows affected by the query.

2)ExecuteReader :- It executes the command defined in the Command Text property against the connection defined in the Connection property. It gives the "reader" object which is connected to the resulting rowset inside the database,& allowing the rows to be retrieved.

3)Execute Scalar :- It executes the command defined in the CommandText property against the connection defined in the Connection property. It Returns only  the single value (effectively the Ist column of the Ist row of the resulting rowset) any other returned columns &  rows are discarded. It is fast and efficient when only a "singleton" value is needed.

Posted Date: 9/24/2012 2:23:04 AM | Location : United States







Related Discussions:- Methods provided by the command object, Assignment Help, Ask Question on Methods provided by the command object, Get Answer, Expert's Help, Methods provided by the command object Discussions

Write discussion on Methods provided by the command object
Your posts are moderated
Related Questions
Question: (a) The ObjectDataSource control is an alternative design approach to using AccessDataSource or SqlDataSource controls. Explain and illustrate how an ObjectDataSourc

Reading strings from the keyboard   using System; class Prog3_1 {       public static void Main()   {    Console.Write ("Enter Your First Name : "); // Displaying to writ

What is Reference counting in COM? The Reference counting is a memory management method used to count the number of times an object has a pointer referring to it. The very firs

The Cache object is always defined in the System.Web.Caching namespace. You can get the reference to the Cache object by either using the Cache property of the HttpContext class in

What are the naming conventions required for XML elements tags? The following are the naming conventions that need to be followed for XML elements tags: Element names should

What is Delegation? A delegate seems like a strongly type function pointer. Delegates can request the methods that they reference without making explicit calls to those methods


What is the difference among a toolstrip drop-down button and a toolstrip split button? The difference among a toolstrip drop-down button and a toolstrip split button is that a

I am looking individuals who have industry experience working on Microsoft Technology and Jquery ( MVC 4.5 ), who will take live online session and give training through Team Viewe

TFS - SpiraTeam synchronization plugin. Project Description: We would like you to develop the subsequent requirements in one plug-in already in production. The plug-in was de