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

📄 productsdataset.designer.cs

📁 Microsoft Mobile Development Handbook的代码,有C#,VB,C++的
💻 CS
📖 第 1 页 / 共 5 页
字号:
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public virtual int Update(System.Data.DataRow dataRow) {
            return this.Adapter.Update(new System.Data.DataRow[] {
                        dataRow});
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public virtual int Update(System.Data.DataRow[] dataRows) {
            return this.Adapter.Update(dataRows);
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
        public virtual int Delete(int p1) {
            this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(p1));
            System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
            if (((this.Adapter.DeleteCommand.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                this.Adapter.DeleteCommand.Connection.Open();
            }
            try {
                int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
                return returnValue;
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.DeleteCommand.Connection.Close();
                }
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
        public virtual int Insert(string p1, string p2, decimal p3, string p4, int p5) {
            if ((p1 == null)) {
                throw new System.ArgumentNullException("p1");
            }
            else {
                this.Adapter.InsertCommand.Parameters[0].Value = ((string)(p1));
            }
            if ((p2 == null)) {
                this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[1].Value = ((string)(p2));
            }
            this.Adapter.InsertCommand.Parameters[2].Value = ((decimal)(p3));
            if ((p4 == null)) {
                this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[3].Value = ((string)(p4));
            }
            this.Adapter.InsertCommand.Parameters[4].Value = ((int)(p5));
            System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
            if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                this.Adapter.InsertCommand.Connection.Open();
            }
            try {
                int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
                return returnValue;
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.InsertCommand.Connection.Close();
                }
            }
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
        public virtual int Update(string p1, string p2, decimal p3, string p4, int p5, int p6) {
            if ((p1 == null)) {
                throw new System.ArgumentNullException("p1");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(p1));
            }
            if ((p2 == null)) {
                this.Adapter.UpdateCommand.Parameters[1].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(p2));
            }
            this.Adapter.UpdateCommand.Parameters[2].Value = ((decimal)(p3));
            if ((p4 == null)) {
                this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(p4));
            }
            this.Adapter.UpdateCommand.Parameters[4].Value = ((int)(p5));
            this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(p6));
            System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
            if (((this.Adapter.UpdateCommand.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                this.Adapter.UpdateCommand.Connection.Open();
            }
            try {
                int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
                return returnValue;
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.UpdateCommand.Connection.Close();
                }
            }
        }
    }
    
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.ComponentModel.DataObjectAttribute(true)]
    public partial class ProductCategoryTableAdapter : 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 ProductCategoryTableAdapter() {
            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 = "ProductCategory";
            tableMapping.ColumnMappings.Add("ProductCategoryID", "ProductCategoryID");
            tableMapping.ColumnMappings.Add("Name", "Name");
            this._adapter.TableMappings.Add(tableMapping);
            this._adapter.DeleteCommand = new System.Data.SqlServerCe.SqlCeCommand();
            this._adapter.DeleteCommand.Connection = this.Connection;
            this._adapter.DeleteCommand.CommandText = "DELETE FROM [ProductCategory] WHERE (([ProductCategoryID] = @p1))";
            this._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text;
            System.Data.SqlServerCe.SqlCeParameter param = new System.Data.SqlServerCe.SqlCeParameter();
            param.ParameterName = "@p1";
            param.DbType = System.Data.DbType.Int32;
            param.IsNullable = true;
            param.SourceColumn = "ProductCategoryID";
            param.SourceVersion = System.Data.DataRowVersion.Original;
            this._adapter.DeleteCommand.Parameters.Add(param);
            this._adapter.InsertCommand = new System.Data.SqlServerCe.SqlCeCommand();
            this._adapter.InsertCommand.Connection = this.Connection;
            this._adapter.InsertCommand.CommandText = "INSERT INTO [ProductCategory] ([Name]) VALUES (@p1)";
            this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
            param = new System.Data.SqlServerCe.SqlCeParameter();
            param.ParameterName = "@p1";
            param.IsNullable = true;
            param.SourceColumn = "Name";
            this._adapter.InsertCommand.Parameters.Add(param);
            this._adapter.UpdateCommand = new System.Data.SqlServerCe.SqlCeCommand();
            this._adapter.UpdateCommand.Connection = this.Connection;
            this._adapter.UpdateCommand.CommandText = "UPDATE [ProductCategory] SET [Name] = @p1 WHERE (([ProductCategoryID] = @p2))";
            this._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text;
            param = new System.Data.SqlServerCe.SqlCeParameter();
            param.ParameterName = "@p1";
            param.IsNullable = true;
            param.SourceColumn = "Name";
            this._adapter.UpdateCommand.Parameters.Add(param);
            param = new System.Data.SqlServerCe.SqlCeParameter();
            param.ParameterName = "@p2";
            param.DbType = System.Data.DbType.Int32;
            param.IsNullable = true;
            param.SourceColumn = "ProductCategoryID";
            param.SourceVersion = System.Data.DataRowVersion.Original;
            this._adapter.UpdateCommand.Parameters.Add(param);
        }
        
        [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 [ProductCategoryID], [Name] FROM [ProductCategory]";
            this._commandCollection[0].CommandType = System.Data.CommandType.Text;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
        public virtual int Fill(ProductsDataSet.ProductCategoryDataTable 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 ProductsDataSet.ProductCategoryDataTable GetData() {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            ProductsDataSet.ProductCategoryDataTable dataTable = new ProductsDataSet.ProductCategoryDataTable();
            this.Adapter.Fill(dataTable);
            return dataTable;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public virtual int U

⌨️ 快捷键说明

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