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


Please Help Members By Posting Answers For Below Questions

Which parameter of ConnectionString is used to specify the name of the database?

542


How to retrieve the user id which is provided while windows authentication?

586


What is concurrency? How will you avoid concurrency when dealing with dataset? (One user deleted one row after that another user through his dataset was trying to update same row. What will happen? How will you avoid the problem?)

577


Why edit is not possible in repeater?

516


Explain why canot we use multiple inheritance and garbage collector paralelly in .net?

587






Is bulk insert faster than insert?

489


What are the data access namespaces in .NET?

626


What is the meaning of object pooling?

590


Define data access layer?

528


Compare Data Reader & Dataset in ado.net?

539


Describe connection object in ado.net

537


What is microsoft ole db provider for sql server?

475


differences between ADO and ADO.NET

566


What are two important objects of ADO.Net?

553


How to identify the updated rows in a dataset?

513