what is different between SqlCommand object and Command
Behaviour Object
Answer Posted / sudhir kumar pal
ADO.NET Command Object - The Command object is similar to
the old ADO command object. It is used to store SQL
statements that need to be executed against a data source.
The Command object can execute SELECT statements, INSERT,
UPDATE, or DELETE statements, stored procedures, or any
other statement understood by the database. See sample
code...
'Code below in VB.NET ...
Dim ObjCom as SqlClient.SqlCommand
ObjCom.SqlConnection(strCon)
ObjCom.Connection.Open()
ObjCom.CommandText = "Select * from tblSample"
ObjCom.ExecuteNonQuery()
SqlCommand objects are not used much when we use datasets
and data adapters. Following are some properties of the
SqlCommand class...
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
What are the advantages of ado.net?
What is sqldatareader?
What is the difference between connected and disconnected environment?
What are the core objects of ADO.NET?
Explain the difference between an ado.net dataset and an ado recordset?
What are the various methods provided by the DataSet object to generate XML?
What is difference between datatable and dataset?
What is meant by ‘transaction’ in a database and what are the ‘properties of transaction’?
What is ado.net object model?
What are the disadvantages of using datalist?
What is difference between datareader and dataadapter?
Explain what are acid properties?
How can you identify whether or not any changes are made to the DataSet object since it was last loaded?
Does ado.net use odbc?
What are good ado.net object to replace to ado recordset object.