windows c# using datagridview in edit form sql server



windows c# using datagridview in edit form sql server..

Answer / Shashank Agarwal

To use DataGridView in an Edit Form to interact with SQL Server database in C# under Windows, you can follow these steps: 1. Install and configure the Microsoft .NET Framework Data Provider for SQL Server (SqlClient) by adding it as a reference in your project. 2. Create a new connection to the SQL Server database using the ADO.NET Connection object. 3. Use the SqlDataAdapter class to create a command object that retrieves data from the SQL Server and fills the DataGridView with the results. 4. Set the DataSource property of the DataGridView to the dataset created in step 3. 5. Add buttons or other controls to allow the user to update, insert, or delete records. 6. Use the SqlCommand object to execute SQL commands based on the user's actions, such as updating a record, inserting a new one, or deleting an existing one.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

How?s method overriding different from overloading?

4 Answers  


How did you implemented classes in your project?

1 Answers   TCS,


Explain the constructor in c#.

1 Answers  


About a class access specifiers and method access specifiers ?

3 Answers   MMTS,


Why do we need encapsulation in c#?

1 Answers  


Is dll a library?

1 Answers  


What is difference between write and writeline in c#?

1 Answers  


What is the property of a class in c#?

1 Answers  


What language do desktop applications use?

1 Answers  


How can we give strong name to assembly? What is satellite assembly?

2 Answers   SMNetserv,


How can you read 3rd line from a text file?

1 Answers  


What is xor operator in c#?

1 Answers  


Categories