How to create a SqlCommand Object in ADO.Net?

How to create a SqlCommand Object in ADO.Net?

SqlCommand cmd = new SqlCommand("select CategoryName from Categories", conn);
Above syntax is written to instantiating a SqlCommand object.  It takes a string parameter that holds the command you want to execute and a reference to a SqlConnection object.

By:Aditya
Date:2028-10-10 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related ADO.NET Subjective Links

ADO.NET Subjective interview questions and answers for experienced and fresher