Import Excel to Datagridview
I am posting a solution for both Excel 2003 and Excel 2007+. You are missing ‘ in Extended Properties For Excel 2003 try this private void button1_Click(object sender, EventArgs e) { String name = “Items”; String constr = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” + “C:\\Sample.xls” + “;Extended Properties=”Excel 8.0;HDR=YES;”;”; OleDbConnection con = new OleDbConnection(constr); OleDbCommand oconn = new … Read more