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

📄 joinquerydataset.designer.cs

📁 Microsoft Mobile Development Handbook的代码,有C#,VB,C++的
💻 CS
📖 第 1 页 / 共 3 页
字号:
                    catch (System.InvalidCastException e) {
                        throw new System.Data.StrongTypingException("The value for column \'CategoryName\' in table \'ProductsCategory\' is DBNull.", e);
                    }
                }
                set {
                    this[this.tableProductsCategory.CategoryNameColumn] = value;
                }
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public bool IsProductIDNull() {
                return this.IsNull(this.tableProductsCategory.ProductIDColumn);
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public void SetProductIDNull() {
                this[this.tableProductsCategory.ProductIDColumn] = System.Convert.DBNull;
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public bool IsNameNull() {
                return this.IsNull(this.tableProductsCategory.NameColumn);
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public void SetNameNull() {
                this[this.tableProductsCategory.NameColumn] = System.Convert.DBNull;
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public bool IsColorNull() {
                return this.IsNull(this.tableProductsCategory.ColorColumn);
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public void SetColorNull() {
                this[this.tableProductsCategory.ColorColumn] = System.Convert.DBNull;
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public bool IsListPriceNull() {
                return this.IsNull(this.tableProductsCategory.ListPriceColumn);
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public void SetListPriceNull() {
                this[this.tableProductsCategory.ListPriceColumn] = System.Convert.DBNull;
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public bool IsSizeNull() {
                return this.IsNull(this.tableProductsCategory.SizeColumn);
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public void SetSizeNull() {
                this[this.tableProductsCategory.SizeColumn] = System.Convert.DBNull;
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public bool IsCategoryNameNull() {
                return this.IsNull(this.tableProductsCategory.CategoryNameColumn);
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public void SetCategoryNameNull() {
                this[this.tableProductsCategory.CategoryNameColumn] = System.Convert.DBNull;
            }
        }
        
        public class ProductsCategoryRowChangeEvent : System.EventArgs {
            
            private ProductsCategoryRow eventRow;
            
            private System.Data.DataRowAction eventAction;
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public ProductsCategoryRowChangeEvent(ProductsCategoryRow row, System.Data.DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public ProductsCategoryRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            public System.Data.DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
namespace MobileDevelopersHandbook.JOINQueryDataSetTableAdapters {
    
    
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.ComponentModel.DataObjectAttribute(true)]
    public partial class ProductsCategoryTableAdapter : System.ComponentModel.Component {
        
        private System.Data.SqlServerCe.SqlCeDataAdapter _adapter;
        
        private System.Data.SqlServerCe.SqlCeConnection _connection;
        
        private System.Data.SqlServerCe.SqlCeCommand[] _commandCollection;
        
        private bool _clearBeforeFill;
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public ProductsCategoryTableAdapter() {
            this.ClearBeforeFill = true;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private System.Data.SqlServerCe.SqlCeDataAdapter Adapter {
            get {
                if ((this._adapter == null)) {
                    this.InitAdapter();
                }
                return this._adapter;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        internal System.Data.SqlServerCe.SqlCeConnection Connection {
            get {
                if ((this._connection == null)) {
                    this.InitConnection();
                }
                return this._connection;
            }
            set {
                this._connection = value;
                if ((this.Adapter.InsertCommand != null)) {
                    this.Adapter.InsertCommand.Connection = value;
                }
                if ((this.Adapter.DeleteCommand != null)) {
                    this.Adapter.DeleteCommand.Connection = value;
                }
                if ((this.Adapter.UpdateCommand != null)) {
                    this.Adapter.UpdateCommand.Connection = value;
                }
                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
                    if ((this.CommandCollection[i] != null)) {
                        ((System.Data.SqlServerCe.SqlCeCommand)(this.CommandCollection[i])).Connection = value;
                    }
                }
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        protected System.Data.SqlServerCe.SqlCeCommand[] CommandCollection {
            get {
                if ((this._commandCollection == null)) {
                    this.InitCommandCollection();
                }
                return this._commandCollection;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public bool ClearBeforeFill {
            get {
                return this._clearBeforeFill;
            }
            set {
                this._clearBeforeFill = value;
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitAdapter() {
            this._adapter = new System.Data.SqlServerCe.SqlCeDataAdapter();
            System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
            tableMapping.SourceTable = "Table";
            tableMapping.DataSetTable = "ProductsCategory";
            tableMapping.ColumnMappings.Add("ProductID", "ProductID");
            tableMapping.ColumnMappings.Add("Name", "Name");
            tableMapping.ColumnMappings.Add("Color", "Color");
            tableMapping.ColumnMappings.Add("ListPrice", "ListPrice");
            tableMapping.ColumnMappings.Add("Size", "Size");
            tableMapping.ColumnMappings.Add("CategoryName", "CategoryName");
            this._adapter.TableMappings.Add(tableMapping);
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitConnection() {
            this._connection = new System.Data.SqlServerCe.SqlCeConnection();
            this._connection.ConnectionString = ("Data Source =" 
                        + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) 
                        + ("\\MyDatabase.sdf;" 
                        + ("Password =" + "\"MobileP@ssw0rd\";"))));
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        private void InitCommandCollection() {
            this._commandCollection = new System.Data.SqlServerCe.SqlCeCommand[1];
            this._commandCollection[0] = new System.Data.SqlServerCe.SqlCeCommand();
            this._commandCollection[0].Connection = this.Connection;
            this._commandCollection[0].CommandText = @"SELECT     Product.ProductID, Product.Name, Product.Color, Product.ListPrice, Product.Size, 
                      ProductCategory.Name AS CategoryName
FROM         Product, ProductCategory
WHERE     Product.ProductCategoryID = ProductCategory.ProductCategoryID";
            this._commandCollection[0].CommandType = System.Data.CommandType.Text;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
        public virtual int Fill(JOINQueryDataSet.ProductsCategoryDataTable dataTable) {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            if ((this.ClearBeforeFill == true)) {
                dataTable.Clear();
            }
            int returnValue = this.Adapter.Fill(dataTable);
            return returnValue;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public virtual JOINQueryDataSet.ProductsCategoryDataTable GetData() {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            JOINQueryDataSet.ProductsCategoryDataTable dataTable = new JOINQueryDataSet.ProductsCategoryDataTable();
            this.Adapter.Fill(dataTable);
            return dataTable;
        }
    }
}
namespace JOINQueryDataSetUtil {
    using System;
    using System.Data;
    
    
    public partial class DesignerUtil {
        
        public static bool IsDesignTime() {
            // Determine if this instance is running against .NET Framework by using the MSCoreLib PublicKeyToken
            System.Reflection.Assembly mscorlibAssembly = typeof(int).Assembly;
            if ((mscorlibAssembly != null)) {
                if (mscorlibAssembly.FullName.ToUpper().EndsWith("B77A5C561934E089")) {
                    return true;
                }
            }
            return false;
        }
        
        public static bool IsRunTime() {
            // Determine if this instance is running against .NET Compact Framework by using the MSCoreLib PublicKeyToken
            System.Reflection.Assembly mscorlibAssembly = typeof(int).Assembly;
            if ((mscorlibAssembly != null)) {
                if (mscorlibAssembly.FullName.ToUpper().EndsWith("969DB8053D3322AC")) {
                    return true;
                }
            }
            return false;
        }
    }
}

⌨️ 快捷键说明

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