OleDbConnection objConnection = new OleDbConnection(); string con = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="+ strSourcePath + "\\" + row.Cells[2].Value.ToString() + ".xls" + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES;IMEX=1;\""; objConnection.ConnectionString = con; OleDbCommand objCommand = new OleDbCommand("SELECT * FROM [Sheet1$]", objConnection); OleDbDataAdapter da = new OleDbDataAdapter(objCommand); DataSet ds = new DataSet(); da.Fill(ds); dataGridView2.DataSource = ds.Tables[0];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)