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

📄 exp7sql2dataset1.designer.cs

📁 WinCE系统的数据库操作示例
💻 CS
📖 第 1 页 / 共 4 页
字号:
            this.Adapter.Fill(dataTable);
            return dataTable;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public virtual int Update(exp7SQL2DataSet1.EmployeesDataTable dataTable) {
            return this.Adapter.Update(dataTable);
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public virtual int Update(exp7SQL2DataSet1 dataSet) {
            return this.Adapter.Update(dataSet, "Employees");
        }
        
        [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(string p1) {
            if ((p1 == null)) {
                throw new System.ArgumentNullException("p1");
            }
            else {
                this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(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, System.Nullable<int> p2, string p3) {
            if ((p1 == null)) {
                throw new System.ArgumentNullException("p1");
            }
            else {
                this.Adapter.InsertCommand.Parameters[0].Value = ((string)(p1));
            }
            if ((p2.HasValue == true)) {
                this.Adapter.InsertCommand.Parameters[1].Value = ((int)(p2.Value));
            }
            else {
                this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
            }
            if ((p3 == null)) {
                this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[2].Value = ((string)(p3));
            }
            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, System.Nullable<int> p2, string p3, string p4) {
            if ((p1 == null)) {
                throw new System.ArgumentNullException("p1");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(p1));
            }
            if ((p2.HasValue == true)) {
                this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(p2.Value));
            }
            else {
                this.Adapter.UpdateCommand.Parameters[1].Value = System.DBNull.Value;
            }
            if ((p3 == null)) {
                this.Adapter.UpdateCommand.Parameters[2].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(p3));
            }
            if ((p4 == null)) {
                throw new System.ArgumentNullException("p4");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(p4));
            }
            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.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, false)]
        public virtual int myDelete(string PARAM) {
            System.Data.SqlServerCe.SqlCeCommand command = this.CommandCollection[3];
            if ((PARAM == null)) {
                throw new System.ArgumentNullException("PARAM");
            }
            else {
                command.Parameters[0].Value = ((string)(PARAM));
            }
            System.Data.ConnectionState previousConnectionState = command.Connection.State;
            if (((command.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                command.Connection.Open();
            }
            int returnValue;
            try {
                returnValue = command.ExecuteNonQuery();
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    command.Connection.Close();
                }
            }
            return returnValue;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, false)]
        public virtual int myInsert(string p1, System.Nullable<int> p2, string p3) {
            System.Data.SqlServerCe.SqlCeCommand command = this.CommandCollection[4];
            if ((p1 == null)) {
                throw new System.ArgumentNullException("p1");
            }
            else {
                command.Parameters[0].Value = ((string)(p1));
            }
            if ((p2.HasValue == true)) {
                command.Parameters[1].Value = ((int)(p2.Value));
            }
            else {
                command.Parameters[1].Value = System.DBNull.Value;
            }
            if ((p3 == null)) {
                command.Parameters[2].Value = System.DBNull.Value;
            }
            else {
                command.Parameters[2].Value = ((string)(p3));
            }
            System.Data.ConnectionState previousConnectionState = command.Connection.State;
            if (((command.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                command.Connection.Open();
            }
            int returnValue;
            try {
                returnValue = command.ExecuteNonQuery();
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    command.Connection.Close();
                }
            }
            return returnValue;
        }
        
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, false)]
        public virtual int Update_Edit(string Name, System.Nullable<int> Age, string Address, string Param1) {
            System.Data.SqlServerCe.SqlCeCommand command = this.CommandCollection[5];
            if ((Name == null)) {
                throw new System.ArgumentNullException("Name");
            }
            else {
                command.Parameters[0].Value = ((string)(Name));
            }
            if ((Age.HasValue == true)) {
                command.Parameters[1].Value = ((int)(Age.Value));
            }
            else {
                command.Parameters[1].Value = System.DBNull.Value;
            }
            if ((Address == null)) {
                command.Parameters[2].Value = System.DBNull.Value;
            }
            else {
                command.Parameters[2].Value = ((string)(Address));
            }
            if ((Param1 == null)) {
                throw new System.ArgumentNullException("Param1");
            }
            else {
                command.Parameters[3].Value = ((string)(Param1));
            }
            System.Data.ConnectionState previousConnectionState = command.Connection.State;
            if (((command.Connection.State & System.Data.ConnectionState.Open) 
                        != System.Data.ConnectionState.Open)) {
                command.Connection.Open();
            }
            int returnValue;
            try {
                returnValue = command.ExecuteNonQuery();
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    command.Connection.Close();
                }
            }
            return returnValue;
        }
    }
}
namespace exp7SQL2DataSet1Util {
    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 + -