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

📄 dataset4.cs

📁 数据库的课程设计作业。管理有关学生、课程的基本信息
💻 CS
📖 第 1 页 / 共 2 页
字号:
            public 选课表Row Add选课表Row(string 课程名, string 姓名, string 学号, string Expr1, string 课程号, string Expr2) {
                选课表Row row选课表Row = ((选课表Row)(this.NewRow()));
                row选课表Row.ItemArray = new object[] {
                        课程名,
                        姓名,
                        学号,
                        Expr1,
                        课程号,
                        Expr2};
                this.Rows.Add(row选课表Row);
                return row选课表Row;
            }
            
            public 选课表Row FindBy学号Expr1课程号Expr2(string 学号, string Expr1, string 课程号, string Expr2) {
                return ((选课表Row)(this.Rows.Find(new object[] {
                            学号,
                            Expr1,
                            课程号,
                            Expr2})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                选课表DataTable cln = ((选课表DataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new 选课表DataTable();
            }
            
            internal void InitVars() {
                this.column课程名 = this.Columns["课程名"];
                this.column姓名 = this.Columns["姓名"];
                this.column学号 = this.Columns["学号"];
                this.columnExpr1 = this.Columns["Expr1"];
                this.column课程号 = this.Columns["课程号"];
                this.columnExpr2 = this.Columns["Expr2"];
            }
            
            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(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课程号 = new DataColumn("课程号", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column课程号);
                this.columnExpr2 = new DataColumn("Expr2", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnExpr2);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.column学号,
                                this.columnExpr1,
                                this.column课程号,
                                this.columnExpr2}, true));
                this.column学号.AllowDBNull = false;
                this.columnExpr1.AllowDBNull = false;
                this.column课程号.AllowDBNull = false;
                this.columnExpr2.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 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 string 课程号 {
                get {
                    return ((string)(this[this.table选课表.课程号Column]));
                }
                set {
                    this[this.table选课表.课程号Column] = value;
                }
            }
            
            public string Expr2 {
                get {
                    return ((string)(this[this.table选课表.Expr2Column]));
                }
                set {
                    this[this.table选课表.Expr2Column] = 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;
            }
        }
        
        [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;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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