welcome folks
FAQ in android,FAQ in dotnet,DotNet, C#,DOT NET CODE, ASP.NET, VB.NET, TRICKS,Dotnetcode,Android and Latest Technology Articles in VB,Android and ASP.NET

Wednesday, August 22, 2012

What is the use of Command objects in ADO.Net?


  • ExecuteNonQuery
  • Executes the command defined in the CommandText property against the connection defined in theConnection property for a query that does not return any row (an UPDATE, DELETE, or INSERT). Returns an Integer indicating the number of rows affected by the query.
  • ExecuteReader
  • Executes the command defined in the CommandText property against the connection defined in theConnection property. Returns a "reader" object that is connected to the resulting row set within the database, allowing the rows to be retrieved.
  • ExecuteScalar
  • Executes the command defined in the CommandText property against the connection defined in theConnection property. Returns only a single value (effectively the first column of the first row of the resulting row set, any other returned columns and rows are discarded). It is fast and efficient when only a "singleton" value is required.

No comments:

Post a Comment