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

📄 dataset5.cs

📁 数据库的课程设计作业。管理有关学生、课程的基本信息
💻 CS
📖 第 1 页 / 共 2 页
字号:
            public 课程表Row Add课程表Row(string 课程名, string 姓名, int 成绩, string 学号, string 课程号, string Expr1) {
                课程表Row row课程表Row = ((课程表Row)(this.NewRow()));
                row课程表Row.ItemArray = new object[] {
                        课程名,
                        姓名,
                        成绩,
                        学号,
                        课程号,
                        Expr1};
                this.Rows.Add(row课程表Row);
                return row课程表Row;
            }
            
            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.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(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.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 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 {
                    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;
            }
        }
        
        [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 + -