Asp.net中把Excel数据存储至SQL Server中的具体实现方(2)

// excel列名不能变
                        string num = dr[i]["学号"].ToString();
                        string name = dr[i]["姓名"].ToString();
                        string pwd = dr[i]["密码"].ToString();
                        string collegeNum = dr[i]["学院编号"].ToString();
                        string birth = dr[i]["生日"].ToString();

if (!BLL.M_CollegeBLL.GetAllCollegeNum().Contains(collegeNum))
                        {
                            error += "所属学院不存 ";
                        }

if (String.IsNullOrEmpty(collegeNum))
                        {
                            error += "请选择该学生所在院系 ";
                        }

if (String.IsNullOrEmpty(num))
                        {
                            error += "学号不能为空 ";
                        }
                        else if (!Utility.IsLetterThanSomeLength(num, 25))
                        {
                            error += "学号的长度过长 ";
                        }

if (String.IsNullOrEmpty(name))
                        {
                            error += "姓名不能为空 ";
                        }
                        else if (!Utility.IsLetterThanSomeLength(name, 25))
                        {
                            error += "姓名的长度过长 ";
                        }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjgjfw.html