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

What is data relation?

0 Answers  


What are the two fundamental objects in ADO.NET?

6 Answers  


What is difference between executequery and executeupdate?

0 Answers  


What are the difference between readonly vs. Const?

0 Answers  


What is data relation in ado.net?

0 Answers  






What is difference between sqldatareader and sqldataadapter?

0 Answers  


What is the difference between connected and disconnected environment?

0 Answers  


What is microsoft ole db provider for sql server?

0 Answers  


What is the meaning of executenonquery?

0 Answers  


What is the difference between executequery and executenonquery?

0 Answers  


What is the provider and namespaces being used to access oracle database?

5 Answers   E2E, Microsoft,


What is sqldatareader?

0 Answers  


Categories