first I want to say thank you all , You have a stuning Job here.
Secondly,
I Want to Import Data from Excel File to My DataGrideview columns.
I tried but data coms after My added columns.Please, Check my code bellow.
- private void button8_Click_1(object sender, EventArgs e)
- {
- string content = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strExcelPathName.Text + "; Extended Properties=\"Excel 8.0;\";";
- OleDbConnection con = new OleDbConnection(content);
- OleDbDataAdapter oda = new OleDbDataAdapter("SELECT * FROM[" + txtSheet.Text + "$]", con);
- DataTable dt = new DataTable();
- oda.Fill(dt);
- dataGridView1.DataSource = dt;
- }
please, help me