public static bool IsHas(string UserID, string identity)//判断原表有没有该老师,有的话就是True,没有是False { DataTable dt = ConnHelper.GetDataTable("select UserID from " + identity + ""); for (int i = 0; i < dt.Rows.Count; i++) { if (UserID == dt.Rows[i]["UserID"].ToString()) { return(true); } } return(false); }
/// <summary> /// 将课程信息导入到数据库 /// 数据来源为全局变量DS集合 /// </summary> /// <param name="identity">表名【非工作簿名】</param> public static void CoursesTOSQLServer(DataTable dt, string identity) { ConnHelper.SQLBulkCopy(dt, identity); }