---
title: "INSERTING DATA AND FETCHING RECORDS FROM DATABASE IN C# .NET"  
description: "First Step is to opena new project in  Microsoft visual studio, then open a Design view in the form and place a  various label as well as text field a"  
author: "Anonymous User"  
published: 2010-09-14  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/131/inserting-data-and-fetching-records-from-database-in-c-sharp-dot-net  
category: "ado.net"  
tags: ["ado.net"]  
reading_time: 2 minutes  

---

# INSERTING DATA AND FETCHING RECORDS FROM DATABASE IN C# .NET

First Step is to open a new project in Microsoft visual studio, then open a Design view in the form and place a various label as well as text field and Buttons in the form. As we have taken five Labels like Employee_id,Employee_Name,Employee_Address,Employee_Phoneno,Employee_Age along with textbox with each of the labels, next we have to take four Buttons as insert Button, previous (<<),Next (>>),and Clear Button we have taken with the help of Toolbox. As shown below.

After setting the above properties to the forms and controls, your form will be shown like below:

\

![INSERTING DATA AND FETCHING RECORDS FROM DATABASE IN C# .NET](https://www.mindstick.com/mindstickarticle/ed3db850-f579-4063-a135-3eabdb6d0161/images/7eaa39af-828f-4905-ab2c-649b2fea8dba.png)

##### Property of Form1 can be set as follows;

| ## Property Name | ## Property Value |
| --- | --- |
| txtid | Employee_id |
| txname | Employee_Name |
| txtAddress | Employee_Address |
| txtphoneno | Employee_phoneno |
| txtAge | Employee_Age |

Next Create a database in the Microsoft SQL Server, with a name mind and add a table name Employee with respected fields. Add fields to the table Employees with the specified data types as given below:

| ## Column Name | ## Data Types |
| --- | --- |
| Employee_id | Int |
| Employee_Name | Varchar(50) |
| Employee_Address | Varchar(50) |
| Employee_phoneno | Varchar(50) |
| Employee_Age | Varchar(50) |

##### The snapshots of the database are shown as:

![SQL Server](https://www.mindstick.com/mindstickarticle/ed3db850-f579-4063-a135-3eabdb6d0161/images/8858f568-ea0d-46b5-b8b4-fd2177dc7768.png)

```
        
```

![INSERTING DATA AND FETCHING RECORDS FROM DATABASE IN C# .NET](https://www.mindstick.com/mindstickarticle/ed3db850-f579-4063-a135-3eabdb6d0161/images/ecfd0e02-71ff-4e77-981e-d5b70f1fd303.png)

\

---

Original Source: https://www.mindstick.com/articles/131/inserting-data-and-fetching-records-from-database-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
