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

📄 book.cs

📁 C#网络实例.里面有很多很实用的C#范例
💻 CS
字号:
//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a tool.
//     Runtime Version: 1.0.2914.16
//
//     Changes to this file may cause incorrect behavior and will be lost if 
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

namespace books {
    using System;
    using System.Data;
    using System.Xml;
    using System.Runtime.Serialization;
    
    
    [Serializable()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public class book : System.Data.DataSet {
        
        private TABLE1DataTable tableTABLE1;
        
        public book() {
            this.InitClass();
        }
        
        private book(SerializationInfo info, StreamingContext context) {
            this.InitClass();
            this.GetSerializationData(info, context);
        }
        
        [System.ComponentModel.Browsable(false)]
        [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
        public TABLE1DataTable TABLE1 {
            get {
                return this.tableTABLE1;
            }
        }
        
        protected override bool ShouldSerializeTables() {
            return false;
        }
        
        protected override bool ShouldSerializeRelations() {
            return false;
        }
        
        protected override void ReadXmlSerializable(XmlReader reader) {
            this.ReadXml(reader, XmlReadMode.IgnoreSchema);
        }
        
        protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
            System.IO.MemoryStream stream = new System.IO.MemoryStream();
            this.WriteXmlSchema(new XmlTextWriter(stream, null));
            stream.Position = 0;
            return System.Xml.Schema.XmlSchema.Read(new XmlTextReader(stream), null);
        }
        
        private void InitClass() {
            this.DataSetName = "book";
            this.Namespace = "http://www.tempuri.org/book.xsd";
            this.tableTABLE1 = new TABLE1DataTable();
            this.Tables.Add(this.tableTABLE1);
        }
        
        private bool ShouldSerializeTABLE1() {
            return false;
        }
        
        public delegate void TABLE1RowChangeEventHandler(object sender, TABLE1RowChangeEvent e);
        
        public class TABLE1DataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn column书名;
            
            private DataColumn column作者;
            
            private DataColumn column出版社;
            
            private DataColumn column出版日期;
            
            private DataColumn column定价;
            
            internal TABLE1DataTable() : 
                    base("TABLE1") {
                this.InitClass();
            }
            
            [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 TABLE1Row this[int index] {
                get {
                    return ((TABLE1Row)(this.Rows[index]));
                }
            }
            
            public event TABLE1RowChangeEventHandler TABLE1RowChanged;
            
            public event TABLE1RowChangeEventHandler TABLE1RowChanging;
            
            public event TABLE1RowChangeEventHandler TABLE1RowDeleted;
            
            public event TABLE1RowChangeEventHandler TABLE1RowDeleting;
            
            public void AddTABLE1Row(TABLE1Row row) {
                this.Rows.Add(row);
            }
            
            public TABLE1Row AddTABLE1Row(string 书名, string 作者, string 出版社, string 出版日期, string 定价) {
                TABLE1Row rowTABLE1Row = ((TABLE1Row)(this.NewRow()));
                rowTABLE1Row.ItemArray = new object[] {
                        书名,
                        作者,
                        出版社,
                        出版日期,
                        定价};
                this.Rows.Add(rowTABLE1Row);
                return rowTABLE1Row;
            }
            
            public TABLE1Row FindBy书名(string 书名) {
                return ((TABLE1Row)(this.Rows.Find(new object[] {
                            书名})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            private void InitClass() {
                this.column书名 = new DataColumn("书名", typeof(string), "", System.Data.MappingType.Element);
                this.column书名.AllowDBNull = false;
                this.column书名.Unique = true;
                this.Columns.Add(this.column书名);
                this.column作者 = new DataColumn("作者", typeof(string), "", System.Data.MappingType.Element);
                this.Columns.Add(this.column作者);
                this.column出版社 = new DataColumn("出版社", typeof(string), "", System.Data.MappingType.Element);
                this.Columns.Add(this.column出版社);
                this.column出版日期 = new DataColumn("出版日期", typeof(string), "", System.Data.MappingType.Element);
                this.Columns.Add(this.column出版日期);
                this.column定价 = new DataColumn("定价", typeof(string), "", System.Data.MappingType.Element);
                this.Columns.Add(this.column定价);
                this.PrimaryKey = new DataColumn[] {
                        this.column书名};
            }
            
            public TABLE1Row NewTABLE1Row() {
                return ((TABLE1Row)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                // We need to ensure that all Rows in the tabled are typed rows.
                // Table calls newRow whenever it needs to create a row.
                // So the following conditions are covered by Row newRow(Record record)
                // * Cursor calls table.addRecord(record) 
                // * table.addRow(object[] values) calls newRow(record)    
                return new TABLE1Row(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(TABLE1Row);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.TABLE1RowChanged != null)) {
                    this.TABLE1RowChanged(this, new TABLE1RowChangeEvent(((TABLE1Row)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.TABLE1RowChanging != null)) {
                    this.TABLE1RowChanging(this, new TABLE1RowChangeEvent(((TABLE1Row)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.TABLE1RowDeleted != null)) {
                    this.TABLE1RowDeleted(this, new TABLE1RowChangeEvent(((TABLE1Row)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.TABLE1RowDeleting != null)) {
                    this.TABLE1RowDeleting(this, new TABLE1RowChangeEvent(((TABLE1Row)(e.Row)), e.Action));
                }
            }
            
            public void RemoveTABLE1Row(TABLE1Row row) {
                this.Rows.Remove(row);
            }
        }
        
        public class TABLE1Row : DataRow {
            
            private TABLE1DataTable tableTABLE1;
            
            internal TABLE1Row(DataRowBuilder rb) : 
                    base(rb) {
                this.tableTABLE1 = ((TABLE1DataTable)(this.Table));
            }
            
            public string 书名 {
                get {
                    return ((string)(this[this.tableTABLE1.书名Column]));
                }
                set {
                    this[this.tableTABLE1.书名Column] = value;
                }
            }
            
            public string 作者 {
                get {
                    try {
                        return ((string)(this[this.tableTABLE1.作者Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableTABLE1.作者Column] = value;
                }
            }
            
            public string 出版社 {
                get {
                    try {
                        return ((string)(this[this.tableTABLE1.出版社Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableTABLE1.出版社Column] = value;
                }
            }
            
            public string 出版日期 {
                get {
                    try {
                        return ((string)(this[this.tableTABLE1.出版日期Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableTABLE1.出版日期Column] = value;
                }
            }
            
            public string 定价 {
                get {
                    try {
                        return ((string)(this[this.tableTABLE1.定价Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableTABLE1.定价Column] = value;
                }
            }
            
            public bool Is作者Null() {
                return this.IsNull(this.tableTABLE1.作者Column);
            }
            
            public void Set作者Null() {
                this[this.tableTABLE1.作者Column] = System.Convert.DBNull;
            }
            
            public bool Is出版社Null() {
                return this.IsNull(this.tableTABLE1.出版社Column);
            }
            
            public void Set出版社Null() {
                this[this.tableTABLE1.出版社Column] = System.Convert.DBNull;
            }
            
            public bool Is出版日期Null() {
                return this.IsNull(this.tableTABLE1.出版日期Column);
            }
            
            public void Set出版日期Null() {
                this[this.tableTABLE1.出版日期Column] = System.Convert.DBNull;
            }
            
            public bool Is定价Null() {
                return this.IsNull(this.tableTABLE1.定价Column);
            }
            
            public void Set定价Null() {
                this[this.tableTABLE1.定价Column] = System.Convert.DBNull;
            }
        }
        
        public class TABLE1RowChangeEvent : EventArgs {
            
            private TABLE1Row eventRow;
            
            private System.Data.DataRowAction eventAction;
            
            public TABLE1RowChangeEvent(TABLE1Row row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public TABLE1Row Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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