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

📄 dataset2.cs

📁 (1) 本光盘是《Visual C#.NET数据库开发经典案例解析》的配套光盘。 (2) 本光盘的主要内容包括各章示例程序的代码及数据库文件。光盘的说明文件为Readme.txt
💻 CS
📖 第 1 页 / 共 2 页
字号:
                班级信息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.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(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.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.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.column班级编号,
                                this.column籍贯编号,
                                this.column民族编号,
                                this.column学籍编号,
                                this.column政治面貌编号}, true));
                this.column班级编号.AllowDBNull = false;
                this.column籍贯编号.AllowDBNull = false;
                this.column民族编号.AllowDBNull = false;
                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 {
                    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 {
                    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 {
                    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 {
                    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 {
                    try {
                        return ((string)(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;
            }
            
            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 + -