How to Save And Retrieve Data with SQL Server and C#

0
121

saveandretrievePIIn this tutorial, I will teach you how to save and retrieve data with SQL Server Management Studio Express 2005 database and C#.net. With this, you can save and retrieve data in the database to the datagridview. I will use here Microsoft Visual Studio 2008 for creating this application.

 

Let’s begin:

 

  • Create a database and name it “userdb”.
  • Open Microsoft Visual Studio 2008 and create new Windows Form Application.
  • Do the Form as follows.

saveandretrievePIfig.1

  • Double click the Form and do the following codes for connecting SQL server to C#.

Note: Put using System.Data.SqlClient; above the namespace to access sql server library.

 

 

  • Go back to the design view and double click the “Save” button. After that, do the following codes for saving data in the database.
  • Go back to the design view an double click the “Load” button. After that, do the following codes for retrieving data in the database to the datagridview.
  • Finally, press F5 on the keyboard to run your project in the computer.

Output:

saveandretrievePI

For all students who need programmer for your thesis system or anyone who needs a sourcecode in any programming languages. You can contact me @ :

 
Email – [email protected]
Mobile No. – 09305235027 – tnt

 

Download Sourcecode

Facebook Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here