# How to Bind GridView to a Local SQL Server

## Environment

| Product Version | Product                  | Author                                                                          |
| --------------- | ------------------------ | ------------------------------------------------------------------------------- |
| 2022.2.622      | RadGridView for WinForms | [Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova) |

## Description

This article offers a step-by-step tutorial how to bind the RadGridView control to the Northwind.Categories table from a local SQL server.

## Solution

Consider that we have a local SQL server with the Northwind database:

![gridview-databinding-tutorial-sql-server 001](https://www.telerik.com/products/winforms/documentation/assets/182d7e330bfc4f9a274acf865afea93e/gridview-databinding-tutorial-sql-server001.png)

Now, we are going to bind the **RadGridView** control in the project to the Northwind.**Categories** table:

![gridview-databinding-tutorial-sql-server 002](https://www.telerik.com/products/winforms/documentation/assets/022b5139e86a6177adae17bbcac9d6aa/gridview-databinding-tutorial-sql-server002.png)

Let's follow the steps:

1\. Select the RadGridView control at design time and open its smart tag. Then, select *Choose DataSource >> Add Project Data Source...* :

![gridview-databinding-tutorial-sql-server 003](https://www.telerik.com/products/winforms/documentation/assets/a6e4d926410b226eac846efa86f7c2fd/gridview-databinding-tutorial-sql-server003.png)

2\. Follow the wizard:

![gridview-databinding-tutorial-sql-server 004](https://www.telerik.com/products/winforms/documentation/assets/20841ce3195432c1f9012728478854ef/gridview-databinding-tutorial-sql-server004.png)

![gridview-databinding-tutorial-sql-server 005](https://www.telerik.com/products/winforms/documentation/assets/785c4016ea69a119c8a5c714cfc48816/gridview-databinding-tutorial-sql-server005.png)

![gridview-databinding-tutorial-sql-server 006](https://www.telerik.com/products/winforms/documentation/assets/a361ccc7d4b67dce5630ada4c715293b/gridview-databinding-tutorial-sql-server006.png)

![gridview-databinding-tutorial-sql-server 007](https://www.telerik.com/products/winforms/documentation/assets/aaede7c38a695668a7a33fec9b412d3f/gridview-databinding-tutorial-sql-server007.png)

3\. Change the Data source to *Microsoft SQL Server* and press OK:

![gridview-databinding-tutorial-sql-server 008](https://www.telerik.com/products/winforms/documentation/assets/d3c0abf1e4a00a96d8e70f61e3f52913/gridview-databinding-tutorial-sql-server008.png)

4\. Enter your *Server name* and select the *database name*, e.g. Northwind:

![gridview-databinding-tutorial-sql-server 009](https://www.telerik.com/products/winforms/documentation/assets/12e7401d165e5384f9f111ff072ddf54/gridview-databinding-tutorial-sql-server009.png)

5\. Confirm the changes and continue the wizard:

![gridview-databinding-tutorial-sql-server 010](https://www.telerik.com/products/winforms/documentation/assets/e861f2913a899a6962e7c199cc268fdc/gridview-databinding-tutorial-sql-server010.png)

6\. Select the Northwind.**Categories** table and click Finish:

![gridview-databinding-tutorial-sql-server 011](https://www.telerik.com/products/winforms/documentation/assets/00b8f8d0f6914c5a3cb0b4dc00de5ab3/gridview-databinding-tutorial-sql-server011.png)

7\. Once the wizard is completed, the respective BindingSource is generated:

![gridview-databinding-tutorial-sql-server 012](https://www.telerik.com/products/winforms/documentation/assets/03e89b186e24e7fa53e288ffaf82d5fd/gridview-databinding-tutorial-sql-server012.png)

8\. Run the project and the grid will be populated with data:

![gridview-databinding-tutorial-sql-server 013](https://www.telerik.com/products/winforms/documentation/assets/673cd4bec87179c12bb3a87067aa1433/gridview-databinding-tutorial-sql-server013.png)

## See Also

* [Tutorial Binding to DataTable or DataSet](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/tutorial-binding-to-datatable-or-dataset)

* [Binding to EntityFramework using Database first approach](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/binding-to-entityframework-using-database-first-approach)
