public ActionResult DATATEST()
        {
            var ss = Request.Files[0].FileName;

            Request.Files[0].SaveAs(Server.MapPath("/uploadXLSXfile/" + ss));

            //insert(ss);
            DataTable table = AsposeOfficeHelper.ReadExcel(Server.MapPath(@"\uploadXLSXfile\" + ss));

            //SessionHelper.Session["data"] = table;
            //SessionHelper.Session["url"] = ss;


            List <Base_User> userlist = new List <Base_User>();

            foreach (DataRow item in table.Rows)
            {
                Base_User user = new Base_User();
                user.RealName = item["姓名"].ToString();
                user.Birthday = DateTime.Parse(item["生日"].ToString());

                userlist.Add(user);
            }

            return(View("show", userlist));
        }
        public ActionResult insert()
        {
            string    filename = SessionHelper.Session["url"].ToString();
            DataTable table    = AsposeOfficeHelper.ReadExcel(Server.MapPath(@"\uploadXLSXfile\" + filename));

            SqlConnection con = new SqlConnection("server=.;database=exsil;uid=sa;pwd=123;");

            con.Open();
            SqlBulkCopy sqlBulkCopy = new SqlBulkCopy(con);

            sqlBulkCopy.DestinationTableName = "users";

            sqlBulkCopy.BatchSize = table.Rows.Count;
            sqlBulkCopy.ColumnMappings.Add("序号", "ID");
            sqlBulkCopy.ColumnMappings.Add("姓名", "name");
            sqlBulkCopy.ColumnMappings.Add("年龄", "age");
            sqlBulkCopy.ColumnMappings.Add("生日", "birthday");

            sqlBulkCopy.WriteToServer(table);

            return(Content("ok"));
        }