using(OleDbConnection Conn= new OleDbConnection("Provider=Microsoft.ACE.OleDb.12.0;Data Source=" + Server.MapPath("/a.xls") + ";Extended Properties=\"excel 8.0;hdr=yes;imex=1\";"))
{
string strCom = "SELECT * FROM [Sheet1$]";
Conn.Open();
OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom,Conn);
DataSet ds = new DataSet();
myCommand.Fill(ds);
Conn.Close();
for(int i=0;i<ds.Tables[0].Rows.Count;i++){
DB.Operate("insert into tm_calls(s_name,s_tel,s_qq,s_more,s_addr,s_user,i_type) values('" + ds.Tables[0].Rows[i]["姓名"] + "','" + ds.Tables[0].Rows[i]["电话"] + "','','" + ds.Tables[0].Rows[i]["公司"] + "" + ds.Tables[0].Rows[i]["电子邮箱"] + "" + ds.Tables[0].Rows[i]["备注"] + "','" + ds.Tables[0].Rows[i]["公司地址"] + "','" + Session["s_username"] + "','3')");
}
}