How do we invoke queries from the application ?

Answers were Sorted based on User's Feedback



How do we invoke queries from the application ?..

Answer / 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

How do we invoke queries from the application ?..

Answer / shwetha

by the namespace using System.Data.Sqlclient


by using Sqlcommand

Dim cmd as new Sqlcommand("Queries");

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More ADO.NET Interview Questions

ADO and ADO.NET differences?

3 Answers   Microsoft,


Difference between ADO and ADO.Net

4 Answers   IBM,


What is difference between ado and other data object?

0 Answers  


What is ado or jdbc?

0 Answers  


What is the use of command objects?

2 Answers  






once data is fetched into dataset connection gets closed. but in datareader connection is always maintained...then why datareader is fast and mainly recommended ?

2 Answers  


How can we perform transactions in .net?

0 Answers  


What is the difference between sqldatareader and sqldataadapter?

0 Answers  


What is Pooling? what is data pooling? what is sql pooling?

3 Answers   TCS,


How does ado.net work?

0 Answers  


What is acid in ado.net?

0 Answers  


What is the use of SqlCommand object?

0 Answers  


Categories