FileInfo fi = new FileInfo(openFileDialog1.FileName); opendir = fi.DirectoryName; string strCsvFilePath = opendir + "\\" + fi.Name; string strFilePath = opendir; string MyConnectStr = "provider=Microsoft.Jet.OLEDB.4.0; data source=" +openFileDialog1.FileName + "; Extended Properties='Excel 8.0;HDR=Yes;IMEX=1;ImportMixedTypes=Text;'"; OleDbConnection MyConnection; MyConnection = new OleDbConnection(MyConnectStr); oleDbDataAdapter1.SelectCommand=new OleDbCommand("select * from [Sheet1$] ", MyConnection); oleDbDataAdapter1.Fill(dataSet1,"excel"); dataGrid1.SetDataBinding(dataSet1,"excel"); MyConnection.Close();