DbCommand Object (ADO.NET)
DbCommand object is
used to send a SQL command to the data store. It can be a Data Manipulation
Language (DML) command to retrieve, insert, update, or delete data. The DbCommand object can also be a Data
Definition Language (DDL) command, which enables you to create tables and
modify schema information at the database.
The following sample shows how to create and initialize a DbCommand object.
var myconnection = new SqlConnection(ConnStr.ConnectionString); var myCommand = myconnection.CreateCommand();var ConnStr = ConfigurationManager.ConnectionStrings["myConnectionString"];
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandText = "EmpList";

Join the conversation! Your thoughts help the community grow.