---
title: "Bind to datagridview"  
description: "Bind to datagridview"  
author: "Anonymous User"  
published: 2014-01-22  
updated: 2014-01-23  
canonical: https://www.mindstick.com/forum/1853/bind-to-datagridview  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Bind to datagridview

How can i [bind data](https://www.mindstick.com/forum/415/how-to-bind-data-in-windows-phone-7-using-wcf-service) to [datagridview](https://www.mindstick.com/articles/607/working-with-datagridview-in-vc-sharp)?

```
DataTable table = new DataTable();string pot = "Provider=Microsoft.Ace.OLEDB.12.0; Data Source = " + textbox_path.Text + ";Extended Properties=\"Excel 8.0; HDR=Yes;\";";OleDbConnection pove = new OleDbConnection(pot);OleDbDataAdapter myDataAdapter = new OleDbDataAdapter("Select * from [" + textbox_sheet.Text + "$]", pove);DataTable dt = new DataTable();myDataAdapter.Fill(dt); /* napaka | oldedb driver ? :O*/dataGridView1.DataSource = dt;
```

## Replies

### Reply by Pravesh Singh

Hi Ankit,\

Add dataGridView1.DataBind(); after dataGridView1.DataSource = dt;.


---

Original Source: https://www.mindstick.com/forum/1853/bind-to-datagridview

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
