C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
5
Reply
How to creating a SqlCommand Object?
Rahul Pandey
12y
1.5k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
syntax to create SqlCommand object SqlCommand
= new SqlCommand("Command to execute i.e. (select,insert,update,delete))", connection objectname);ex: if u want to retrieve data from sql server we use select command i.e SqlComand cmd = new SqlCommnd("Select * from Table_Employee",conn);conn--> SqlConnection Object cmd--> SqlCommand Object
Srinivas Pabballa
10y
0
Sqlcommand com=new Sqlcommand(query,connection object);
Rahul Prajapat
10y
0
Using(Sqlcommand cmd = new Sqlcommand(Select * from TableName,Sqlconnection)) {//Your code here }
Pramod Lawate
12y
0
sqlcommand cmd=new sqlcommand("select * from emp",con);con- connection object.
Srikanth Reddy
12y
0
SqlConnection con = new SqlConnection("Data Source=ABC;Initial Catalog=studentdetail;uid=sa; pwd=Password1");SqlCommand cmd = new SqlCommand("Select * from Tablename",connection); con.open();
Priti Kumari
12y
0
What are different types of Commands available with DataAdapter ?
What is the provider and namespaces being used to access oracle database?
Message