Users Pricing

forum

Home Forums Bind to datagridview – MindStick

Bind to datagridview

Anonymous User 1873 22 Jan 2014

How can i bind data to datagridview?

DataTable table = new DataTable();
string pot = "Provider=Microsoft.Ace.OLEDB.12.0; Data Source = " + textbopath.Text + ";Extended Properties=\"Excel 8.0; HDR=Yes;\";";
OleDbConnection pove = new OleDbConnection(pot);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter("Select * from [" + textbosheet.Text + "$]", pove);
DataTable dt = new DataTable();
myDataAdapter.Fill(dt); /* napaka | oldedb driver ? :O*/
dataGridView1.DataSource = dt;

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md