In this post i am posting a simple C# console program to start with ADO.NET. This may help the beginners in understanding the insertion of data into a database from a C# program.

Before going for the program create a table in sql server using the following command:

Now I am writing a C#  program to insert data into the table EMP_DETAILS..


Execute the program to insert the records in the table EMP_DETAILS. The sample output is given below.


Now open the sql server and type the following command and execute.

Then u can see the inserted records in the table EMP_DETAILS as shown below.

3 thoughts on “Simple C# program with ADO.NET”

Comments are closed.