⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dataset2.cs

📁 数据库的课程设计作业。管理有关学生、课程的基本信息
💻 CS
📖 第 1 页 / 共 3 页
字号:
            }
            
            protected override DataTable CreateInstance() {
                return new 选课表DataTable();
            }
            
            internal void InitVars() {
                this.column姓名 = this.Columns["姓名"];
                this.column课程名 = this.Columns["课程名"];
                this.column学分 = this.Columns["学分"];
                this.column成绩 = this.Columns["成绩"];
                this.column教师 = this.Columns["教师"];
                this.column班级名称 = this.Columns["班级名称"];
                this.column必修或选修 = this.Columns["必修或选修"];
                this.column学号 = this.Columns["学号"];
                this.column课程号 = this.Columns["课程号"];
                this.columnExpr1 = this.Columns["Expr1"];
            }
            
            private void InitClass() {
                this.column姓名 = new DataColumn("姓名", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column姓名);
                this.column课程名 = new DataColumn("课程名", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column课程名);
                this.column学分 = new DataColumn("学分", typeof(System.Single), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column学分);
                this.column成绩 = new DataColumn("成绩", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column成绩);
                this.column教师 = new DataColumn("教师", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column教师);
                this.column班级名称 = new DataColumn("班级名称", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column班级名称);
                this.column必修或选修 = new DataColumn("必修或选修", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column必修或选修);
                this.column学号 = new DataColumn("学号", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column学号);
                this.column课程号 = new DataColumn("课程号", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column课程号);
                this.columnExpr1 = new DataColumn("Expr1", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnExpr1);
                this.column学号.AllowDBNull = false;
                this.column课程号.AllowDBNull = false;
                this.columnExpr1.AllowDBNull = false;
            }
            
            public 选课表Row New选课表Row() {
                return ((选课表Row)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new 选课表Row(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(选课表Row);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.选课表RowChanged != null)) {
                    this.选课表RowChanged(this, new 选课表RowChangeEvent(((选课表Row)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.选课表RowChanging != null)) {
                    this.选课表RowChanging(this, new 选课表RowChangeEvent(((选课表Row)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.选课表RowDeleted != null)) {
                    this.选课表RowDeleted(this, new 选课表RowChangeEvent(((选课表Row)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.选课表RowDeleting != null)) {
                    this.选课表RowDeleting(this, new 选课表RowChangeEvent(((选课表Row)(e.Row)), e.Action));
                }
            }
            
            public void Remove选课表Row(选课表Row row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class 选课表Row : DataRow {
            
            private 选课表DataTable table选课表;
            
            internal 选课表Row(DataRowBuilder rb) : 
                    base(rb) {
                this.table选课表 = ((选课表DataTable)(this.Table));
            }
            
            public string 姓名 {
                get {
                    try {
                        return ((string)(this[this.table选课表.姓名Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table选课表.姓名Column] = value;
                }
            }
            
            public string 课程名 {
                get {
                    try {
                        return ((string)(this[this.table选课表.课程名Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table选课表.课程名Column] = value;
                }
            }
            
            public System.Single 学分 {
                get {
                    try {
                        return ((System.Single)(this[this.table选课表.学分Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table选课表.学分Column] = value;
                }
            }
            
            public int 成绩 {
                get {
                    try {
                        return ((int)(this[this.table选课表.成绩Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table选课表.成绩Column] = value;
                }
            }
            
            public string 教师 {
                get {
                    try {
                        return ((string)(this[this.table选课表.教师Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table选课表.教师Column] = value;
                }
            }
            
            public string 班级名称 {
                get {
                    try {
                        return ((string)(this[this.table选课表.班级名称Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table选课表.班级名称Column] = value;
                }
            }
            
            public string 必修或选修 {
                get {
                    try {
                        return ((string)(this[this.table选课表.必修或选修Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table选课表.必修或选修Column] = value;
                }
            }
            
            public string 学号 {
                get {
                    return ((string)(this[this.table选课表.学号Column]));
                }
                set {
                    this[this.table选课表.学号Column] = value;
                }
            }
            
            public string 课程号 {
                get {
                    return ((string)(this[this.table选课表.课程号Column]));
                }
                set {
                    this[this.table选课表.课程号Column] = value;
                }
            }
            
            public string Expr1 {
                get {
                    return ((string)(this[this.table选课表.Expr1Column]));
                }
                set {
                    this[this.table选课表.Expr1Column] = value;
                }
            }
            
            public bool Is姓名Null() {
                return this.IsNull(this.table选课表.姓名Column);
            }
            
            public void Set姓名Null() {
                this[this.table选课表.姓名Column] = System.Convert.DBNull;
            }
            
            public bool Is课程名Null() {
                return this.IsNull(this.table选课表.课程名Column);
            }
            
            public void Set课程名Null() {
                this[this.table选课表.课程名Column] = System.Convert.DBNull;
            }
            
            public bool Is学分Null() {
                return this.IsNull(this.table选课表.学分Column);
            }
            
            public void Set学分Null() {
                this[this.table选课表.学分Column] = System.Convert.DBNull;
            }
            
            public bool Is成绩Null() {
                return this.IsNull(this.table选课表.成绩Column);
            }
            
            public void Set成绩Null() {
                this[this.table选课表.成绩Column] = System.Convert.DBNull;
            }
            
            public bool Is教师Null() {
                return this.IsNull(this.table选课表.教师Column);
            }
            
            public void Set教师Null() {
                this[this.table选课表.教师Column] = System.Convert.DBNull;
            }
            
            public bool Is班级名称Null() {
                return this.IsNull(this.table选课表.班级名称Column);
            }
            
            public void Set班级名称Null() {
                this[this.table选课表.班级名称Column] = System.Convert.DBNull;
            }
            
            public bool Is必修或选修Null() {
                return this.IsNull(this.table选课表.必修或选修Column);
            }
            
            public void Set必修或选修Null() {
                this[this.table选课表.必修或选修Column] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class 选课表RowChangeEvent : EventArgs {
            
            private 选课表Row eventRow;
            
            private DataRowAction eventAction;
            
            public 选课表RowChangeEvent(选课表Row row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public 选课表Row Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class 课程表DataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnID;
            
            private DataColumn column课程号;
            
            private DataColumn column教师;
            

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -