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

📄 dataset1.cs

📁 原代码详细说明是关于c++方面的希望可以帮助大家使用
💻 CS
📖 第 1 页 / 共 2 页
字号:
            
            public event studentRowChangeEventHandler studentRowChanging;
            
            public event studentRowChangeEventHandler studentRowDeleted;
            
            public event studentRowChangeEventHandler studentRowDeleting;
            
            public void AddstudentRow(studentRow row) {
                this.Rows.Add(row);
            }
            
            public studentRow AddstudentRow(string stud_id, string stud_name, string stud_sex) {
                studentRow rowstudentRow = ((studentRow)(this.NewRow()));
                rowstudentRow.ItemArray = new object[] {
                        stud_id,
                        stud_name,
                        stud_sex};
                this.Rows.Add(rowstudentRow);
                return rowstudentRow;
            }
            
            public studentRow FindBystud_id(string stud_id) {
                return ((studentRow)(this.Rows.Find(new object[] {
                            stud_id})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                studentDataTable cln = ((studentDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new studentDataTable();
            }
            
            internal void InitVars() {
                this.columnstud_id = this.Columns["stud_id"];
                this.columnstud_name = this.Columns["stud_name"];
                this.columnstud_sex = this.Columns["stud_sex"];
            }
            
            private void InitClass() {
                this.columnstud_id = new DataColumn("stud_id", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnstud_id);
                this.columnstud_name = new DataColumn("stud_name", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnstud_name);
                this.columnstud_sex = new DataColumn("stud_sex", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnstud_sex);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnstud_id}, true));
                this.columnstud_id.AllowDBNull = false;
                this.columnstud_id.Unique = true;
            }
            
            public studentRow NewstudentRow() {
                return ((studentRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new studentRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(studentRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.studentRowChanged != null)) {
                    this.studentRowChanged(this, new studentRowChangeEvent(((studentRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.studentRowChanging != null)) {
                    this.studentRowChanging(this, new studentRowChangeEvent(((studentRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.studentRowDeleted != null)) {
                    this.studentRowDeleted(this, new studentRowChangeEvent(((studentRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.studentRowDeleting != null)) {
                    this.studentRowDeleting(this, new studentRowChangeEvent(((studentRow)(e.Row)), e.Action));
                }
            }
            
            public void RemovestudentRow(studentRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class studentRow : DataRow {
            
            private studentDataTable tablestudent;
            
            internal studentRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tablestudent = ((studentDataTable)(this.Table));
            }
            
            public string stud_id {
                get {
                    return ((string)(this[this.tablestudent.stud_idColumn]));
                }
                set {
                    this[this.tablestudent.stud_idColumn] = value;
                }
            }
            
            public string stud_name {
                get {
                    try {
                        return ((string)(this[this.tablestudent.stud_nameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tablestudent.stud_nameColumn] = value;
                }
            }
            
            public string stud_sex {
                get {
                    try {
                        return ((string)(this[this.tablestudent.stud_sexColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tablestudent.stud_sexColumn] = value;
                }
            }
            
            public bool Isstud_nameNull() {
                return this.IsNull(this.tablestudent.stud_nameColumn);
            }
            
            public void Setstud_nameNull() {
                this[this.tablestudent.stud_nameColumn] = System.Convert.DBNull;
            }
            
            public bool Isstud_sexNull() {
                return this.IsNull(this.tablestudent.stud_sexColumn);
            }
            
            public void Setstud_sexNull() {
                this[this.tablestudent.stud_sexColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class studentRowChangeEvent : EventArgs {
            
            private studentRow eventRow;
            
            private DataRowAction eventAction;
            
            public studentRowChangeEvent(studentRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public studentRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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