Frequently Asked Interview Questions

What are the methods provided by the command object?

  • ExecuteNonQuery: Executes the command defined in the CommandText property against the connection defined in the Connection property for a query that does not return any rows (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 the Connection property. Returns a "reader" object that is connected to the resulting rowset within the database, allowing the rows to be retrieved.
  • ExecuteScalar: Executes the command defined in the CommandText property against the connection defined in the Connection property. Returns only a single value (effectively the first column of the first row of the resulting rowset). Any other returned columns and rows are discarded

Most Visited Pages

Home | Site Index | Contact Us