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;
Pravesh Singh
23-Jan-2014Add dataGridView1.DataBind(); after dataGridView1.DataSource = dt;.