How do we invoke queries from the application ?

Answer Posted / vivek

Command object is only one to execute queries in the
backend.
Ex:
SqlConnection cn=new SqlConnection();
SqlCommand cmd=new SqlCommand("SELECT * FROM EMP",cn);
cmd.ExecuteNonQuery();
cmd.ExecuteReader();
cmd.ExecuteScalar();
Cmd.ExecuteXmlReader();
command object has only these 4 methods to execute queries
in the backend.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a control toolbox?

505


What is a sqldataadapter?

526


Why is ADO.NET serialization slower than ADO ?

569


What is the DataTableCollection?

577


What is a serialized object?

538






Explain the role of data provider in ado.net?

546


What we do with the object of ado.net dataset after using it?

524


What is ole db and odbc?

521


What is the difference between typed and untyped dataset?

510


How to add a check box or a dropdown list to a column in a datagrid?

538


What is the difference between statement and preparedstatement interface?

565


What is the difference between Datareader and Dataset?

541


What is the difference between Command and CommandBuilder object?

591


What is connection string?

529


What is oledb connection?

509