Use this code
usingSystem;usingSystem.Data;usingSystem.Data.OleDb;usingSystem.IO;usingSystem.Windows.Forms;namespaceWindowsFormsApplication3{publicpartialclassForm2:Form{publicForm2(){InitializeComponent();}privatevoid button1_Click(object sender,EventArgs e){var dt =newDataTable();var fileName =Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"File1.xlsx");var query ="SELECT F1 As A, F2 As B, F3 As C FROM [Sheet1$]";using(OleDbConnection cn =newOleDbConnection{ConnectionString=ConnectionString(fileName,"No")}){using(OleDbCommand cmd =newOleDbCommand{CommandText= query,Connection= cn }){ cn.Open();OleDbDataReader dr = cmd.ExecuteReader(); dt.Load(dr);}}if(dt.Rows.Count>1){// remove header dt.Rows[0].Delete();} dt.AcceptChanges();Console.WriteLine();}publicstringConnectionString(stringFileName,stringHeader){OleDbConnectionStringBuilderBuilder=newOleDbConnectionStringBuilder();if(Path.GetExtension(FileName).ToUpper()==".XLS"){Builder.Provider="Microsoft.Jet.OLEDB.4.0";Builder.Add("Extended Properties",string.Format("Excel 8.0;IMEX=1;HDR={0};",Header));}else{Builder.Provider="Microsoft.ACE.OLEDB.12.0";Builder.Add("Extended Properties",string.Format("Excel 12.0;IMEX=1;HDR={0};",Header));}Builder.DataSource=FileName;returnBuilder.ConnectionString;}}}
or try to ZetExcel.com this would help you.
Thanks