DataSet ds=new DataSet();
string connStr="provider=MicroSoft.Jet.OLEDB.4.0;Data Source="+strFileName+";Extended Properties=Excel 8.0";
string commStr="select * from ["+GetResellerType(ResellerType)[1].ToString()+string.Format("$] where 渠道编号<>'' ",ResellerType);
OleDbConnection myConn=new OleDbConnection(connStr);
OleDbCommand myComm=new OleDbCommand(commStr);
OleDbDataAdapter myAd=new OleDbDataAdapter(commStr,connStr);
myAd.Fill(ds);
myConn.Close();
return ds.Tables[0];
转载于:https://www.cnblogs.com/yuanweisen/archive/2009/03/03/1402239.html