//获取xls中的数据
public static DataTable GetContentTable(string xlspath)
{
DataTable table = new DataTable();
//string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + xlspath + ";" +
//"Extended Properties='Excel 12.0;HDR=No'";
string strConn = "Provider=Microsoft.Ace.OleDb.12.0;" + "data source=" + xlspath + ";Extended Properties='Excel 12.0; HDR=NO; IMEX=1'";
DataSet ds = new DataSet();
OleDbDataAdapter oada = new OleDbDataAdapter("select * from [Sheet1$]", strConn);
oada.Fill(ds);
table = ds.Tables[0];
return table;
}