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.

csharp-first-database-program_output

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”

Leave a Reply

Your email address will not be published. Required fields are marked *