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 Is Difference Between Ado And Ado.net?
What does executenonquery () method return?
What is the full form of ado.net?
What are the different methods available under the sqlcommand class to access the data?
In how many ways we can retrieve table records count? How to find the count of records in a dataset?
How to load multiple tables into a dataset?
Explain the architecture of ado.net?
What is bubbled event can you please explain?
What is the difference between sqldatareader and sqldataadapter?
What is method to get XML and schema from Dataset? getXML() and get Schema ()
What is the difference between a datareader and a dataset?
What is the difference between the clone() and copy() methods of the dataset class?
Which property is used to check whether a DataReader is closed or opened?
What is an example of ordinal data?
What is the difference between executequery and executenonquery?