forum

home / developersection / forums / bind to datagridview

Bind to datagridview

Anonymous User 1773 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;

c# c# 
Updated on 23-Jan-2014

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By