Example #1
0
        //这里用不上了

        /*
         * private void test()
         * {
         *  sql.InsertValues("department", new string[] { "000", "英才实验学院", "张三" });
         *  sql.InsertValues("department", new string[] { "001", "通信与信息工程学院", "李四" });
         *  sql.InsertValues("department", new string[] { "002", "电子工程学院", "王五" });
         *  sql.InsertValues("department", new string[] { "003", "微电子与固体电子学院", "丰起" });
         *  sql.InsertValues("department", new string[] { "004", "物理电子学院", "木华" });
         *  sql.InsertValues("department", new string[] { "005", "光电信息学院", "曹德" });
         *  sql.InsertValues("department", new string[] { "006", "计算机科学与工程学院", "鲁单" });
         *  sql.InsertValues("department", new string[] { "007", "自动化工程学院", "欧阳德" });
         *  sql.InsertValues("department", new string[] { "008", "机械电子工程学院", "孔德" });
         *  sql.InsertValues("department", new string[] { "009", "生命科学与技术学院", "刘辉" });
         *  sql.InsertValues("department", new string[] { "010", "数学科学学院", "纪德" });
         *  sql.InsertValues("department", new string[] { "011", "经济与管理学院", "谷大度" });
         *  sql.InsertValues("department", new string[] { "012", "政治与公共管理学院", "凯林" });
         *  sql.InsertValues("department", new string[] { "013", "外国语学院", "商学起" });
         *  sql.InsertValues("department", new string[] { "017", "能源科学与工程学院", "胡一宗" });
         *  sql.InsertValues("department", new string[] { "018", "资源与环境学院", "牛胜" });
         *  sql.InsertValues("department", new string[] { "019", "航空航天学院", "武列" });
         *  sql.InsertValues("department", new string[] { "022", "信息软件工程学院", "郭能" });
         *
         *  sql.InsertValues("student", new string[] { "15022101", "雷雪怡", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022102", "汤万福", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022103", "董尚华", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022104", "韩雪玲", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022105", "马亦龙", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022106", "赵晓燕", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022107", "梁泽", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022108", "丁鹏", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022109", "王永涛", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022110", "武思阳", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022111", "谢希栋", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022112", "代金营", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022113", "王贵昌", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022114", "杨兴博", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022115", "张玉霞", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022116", "李晓玉", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022117", "王晓阳", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022118", "姚敏", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022119", "刘丽华", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022120", "李志坚", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022121", "邸婷", "女", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022122", "王丹", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022123", "赵明鑫", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022124", "王斐斐", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022125", "陶学斌", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022126", "张乾", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022127", "项安", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022128", "武玉娇", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022129", "葛婷", "女", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022130", "马倩", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022131", "孙玉杰", "男", "19", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022132", "常伟天", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022133", "李文婷", "女", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022134", "朱天昌", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022135", "尚海莲", "女", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022136", "胡建华", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022137", "付天君", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022138", "孙云", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022139", "韩福洁", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022140", "王帅", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022141", "宋银玉", "女", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022142", "戴丽", "女", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022143", "张成江", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022144", "杨晓荣", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022145", "刘盛林", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022146", "单永枭", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022147", "苏宁", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022148", "张元钟", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022149", "毛仲锦", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022150", "刘德新", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022151", "赵毅", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022152", "秦彬耀", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022153", "陈玉红", "女", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022154", "鲁娅楠", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022155", "马俊杰", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022156", "马亦龙", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022157", "展大振", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022158", "李建", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022159", "张大砚", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022160", "马江山", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022161", "周震", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022162", "王文博", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022163", "章亮", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022164", "周江", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022165", "姚积刚", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022166", "曹利文", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022167", "梁大森", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022168", "张朝志", "男", "21", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022169", "马耀彪", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022170", "张振昌", "男", "20", "光电信息学院" });
         *  sql.InsertValues("student", new string[] { "15022171", "薛琴", "女", "21", "光电信息学院" });
         *
         *  sql.InsertValues("course", new string[] { "10129014", "《红楼梦》专题研讨", "", "5" });
         *  sql.InsertValues("course", new string[] { "10229035", "《史记》选读", "", "4" });
         *  sql.InsertValues("course", new string[] { "11029001", "奥林匹克运动", "", "5" });
         *  sql.InsertValues("course", new string[] { "11929002", "办公室管理与文秘写作", "", "3" });
         *  sql.InsertValues("course", new string[] { "11229049", "北洋军阀史", "", "4" });
         *  sql.InsertValues("course", new string[] { "12229002", "比较政治制度", "", "5" });
         *  sql.InsertValues("course", new string[] { "11229047", "大国的兴衰", "", "5" });
         *  sql.InsertValues("course", new string[] { "11729001", "大学生健康教育", "", "4" });
         *  sql.InsertValues("course", new string[] { "10129001", "大学生就业指导", "", "3" });
         *  sql.InsertValues("course", new string[] { "12229011", "大学生心理素质教育", "", "5" });
         *  sql.InsertValues("course", new string[] { "11529008", "大学生心理与成才", "", "5" });
         * }
         */
        #endregion
        private void btnInit_Click(object sender, EventArgs e)
        {
            sql.CloseConnection();
            GC.Collect();
            GC.WaitForPendingFinalizers();
            byte[] byDll   = global::ClassSys.Properties.Resources.mydb; //获取嵌入dll文件的字节数组
            string strPath = Application.StartupPath + @"\mydb.db";      //设置释放路径   导出路径

            //创建dll文件(覆盖模式)
            using (FileStream fs = new FileStream(strPath, FileMode.Create))
            {
                fs.Write(byDll, 0, byDll.Length);
            }
            sql = new SqLiteHelper("data source=" + Application.StartupPath + "\\mydb.db");
            //---------------------初始化界面-----------------------
            InitStudent();
            InitCourse();
            InitTeacher();
            InitDepartment();
            InitSct();
            //--------------------------------------------------------
            MessageBox.Show("重新初始化数据成功");
        }