Each data provider included with the .net framework has its own command object
Every command object inherits from class DbCommand
Providers and their command objects are as under:
OLE DB : OleDbCommand
SQL Server : SqlCommand
ODBC Command : OdbcCommand
Oracle : OracleCommand
Methods common to these providers are:
ExecuteReader : Returns a DataReader object
ExecuteScalar : Returns a single scalar value
ExecuteScalar is used to retrieve a single value (like avg, max, min)
ExecuteNonQuery : Execute a command that does not return any value
ExecuteNonQuery returns no rows
It returns the number of rows affected
Used for Update, Insert, Delete
ExecuteXMLReader : Returns an XMLReader
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment