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

Does dapper use ado.net?

769


What is ado net stands for?

694


Explain ODP.net

753


What is linq and entity framework?

687


How to read data with the sqldatareader ?

730


What is ado code?

691


What is the difference between linq and ado.net?

714


What two types of data providers does ADO.NET supply? What determines which one you should use?

728


Which object holds only data and does not interact with data source?

713


How to work with disconnected data - the dataset and sqldataadapter?

719


Explian About DataAdapters

771


What is ole2 format?

665


What is difference between datagridview and datagrid control in winforms?

698


Why edit is not possible in repeater?

694


What is shadow copy?

748