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

📄 dataset1.cs

📁 数据库的课程设计作业。管理有关学生、课程的基本信息
💻 CS
📖 第 1 页 / 共 5 页
字号:
                this.column姓名 = this.Columns["姓名"];
                this.column课程名 = this.Columns["课程名"];
                this.column成绩 = this.Columns["成绩"];
                this.column上课开始日期 = this.Columns["上课开始日期"];
                this.column上课结束日期 = this.Columns["上课结束日期"];
            }
            
            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.column成绩 = new DataColumn("成绩", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column成绩);
                this.column上课开始日期 = new DataColumn("上课开始日期", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column上课开始日期);
                this.column上课结束日期 = new DataColumn("上课结束日期", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.column上课结束日期);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.column学号}, true));
                this.column学号.AllowDBNull = false;
                this.column学号.Unique = true;
                this.column姓名.AllowDBNull = false;
                this.column课程名.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 {
                    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 课程名 {
                get {
                    return ((string)(this[this.table历史表.课程名Column]));
                }
                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 System.DateTime 上课开始日期 {
                get {
                    try {
                        return ((System.DateTime)(this[this.table历史表.上课开始日期Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table历史表.上课开始日期Column] = value;
                }
            }
            
            public System.DateTime 上课结束日期 {
                get {
                    try {
                        return ((System.DateTime)(this[this.table历史表.上课结束日期Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.table历史表.上课结束日期Column] = 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;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class 选课表DataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn column学号;
            
            private DataColumn column课程号;
            
            private DataColumn column成绩;
            
            private DataColumn column上课起始日期;
            
            private DataColumn column上课结束日期;
            
            internal 选课表DataTable() : 
                    base("选课表") {
                this.InitClass();
            }
            
            internal 选课表DataTable(DataTable table) : 
                    base(table.TableName) {
                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                    this.CaseSensitive = table.CaseSensitive;
                }
                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                    this.Locale = table.Locale;
                }
                if ((table.Namespace != table.DataSet.Namespace)) {
                    this.Namespace = table.Namespace;
                }
                this.Prefix = table.Prefix;
                this.MinimumCapacity = table.MinimumCapacity;
                this.DisplayExpression = table.DisplayExpression;
            }
            
            [System.ComponentModel.Browsable(false)]
            public int Count {
                get {
                    return this.Rows.Count;
                }
            }
            
            internal DataColumn 学号Column {
                get {
                    return this.column学号;
                }
            }
            
            internal DataColumn 课程号Column {
                get {
                    return this.column课程号;
                }
            }
            
            internal DataColumn 成绩Column {
                get {
                    return this.column成绩;
                }
            }
            
            internal DataColumn 上课起始日期Column {
                get {
                    return this.column上课起始日期;
                }
            }
            
            internal DataColumn 上课结束日期Column {
                get {
                    return this.column上课结束日期;
                }
            }
            
            public 选课表Row this[int index] {
                get {
                    return ((选课表Row)(this.Rows[index]));
                }
            }
            
            public event 选课表RowChangeEventHandler 选课表RowChanged;
            
            public event 选课表RowChangeEventHandler 选课表RowChanging;
            
            public event 选课表RowChangeEventHandler 选课表RowDeleted;
            
            public event 选课表RowChangeEventHandler 选课表RowDeleting;
            
            public void Add选课表Row(选课表Row row) {
                this.Rows.Add(row);
            }
            
            public 选课表Row Add选课表Row(string 学号, string 课程号, int 成绩, System.DateTime 上课起始日期, System.DateTime 上课结束日期) {
                选课表Row row选课表Row = ((选课表Row)(this.NewRow()));
                row选课表Row.ItemArray = new object[] {
                        学号,
                        课程号,
                        成绩,
                        上课起始日期,
                        上课结束日期};
                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["上课结束日期"];
            }
            
            private void InitClass() {
                this.column学号 = new DataColumn("学号", typeof(string), null, System.Data.MappingType.Element);

⌨️ 快捷键说明

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