Ejemplo n.º 1
0
        public global::System.Data.SqlClient.SqlCommand BuildCommand(global::System.Data.SqlClient.SqlConnection connection)
        {
            var command = new global::System.Data.SqlClient.SqlCommand();

            this.BuildCommand(command, connection);
            return(command);
        }
Ejemplo n.º 2
0
        public SqlConnection(global::System.Data.SqlClient.SqlConnection connection, IExecuteReaderProvider executeReaderProvider)
        {
            if (connection == null) throw new ArgumentNullException("connection");
            if (executeReaderProvider == null) throw new ArgumentNullException("executeReaderProvider");

            this.connection = connection;
            this.executeReaderProvider = executeReaderProvider;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlCmdBuilderFactory"/> class.
 /// </summary>
 /// <param name="connectionStringFactory">The connection string factory.</param>
 /// <exception cref="System.ArgumentNullException">connectionStringFactory</exception>
 public SqlCmdBuilderFactory(global::System.Func <string> connectionStringFactory)
 {
     if (ReferenceEquals(null, connectionStringFactory))
     {
         throw new global::System.ArgumentNullException(nameof(connectionStringFactory));
     }
     this.m_connectionFactory = () =>
     {
         var connectionString = connectionStringFactory();
         var connection       = new global::System.Data.SqlClient.SqlConnection(connectionString);
         return(connection);
     };
 }
        /// <summary>
        /// Processes the completion of a transaction.
        /// </summary>
        /// <param name="sender">The object that originated the event.</param>
        /// <param name="transactionEventArgs">The event arguments.</param>
        private void OnTransactionCompleted(object sender, global::System.Transactions.TransactionEventArgs transactionEventArgs)
        {
            try
            {
                if (FluidTrade.Core.EventLog.IsLoggingEnabledFor(FluidTrade.Core.EventLog.ErrorLogLevel.Verbose))
                {
                    this.stackTrce += " closing";
                }

                lock (this)
                {
                    if (this.sqlConnection != null)
                    {
                        this.sqlConnection.Close();
                        this.sqlConnection = null;
                    }
                }
            }
            finally
            {
                if (this.ClearRowLockList())
                {
                    try
                    {
                        global::FluidTrade.Core.EventLog.Information("<<<***>>> OnTransactionCompleted cleared rows in List");
                    }
                    catch
                    {
                    }
                }

                global::System.Threading.Monitor.Enter(DataModelTransaction.syncRoot);
                try
                {
                    DataModelTransaction.transactionTable.Remove(this.localIdentifier);
                    //global::System.Transactions.Transaction transaction = transactionEventArgs.Transaction;
                    //string localIdentifier = transaction.TransactionInformation.LocalIdentifier;
                    //DataModelTransaction dataModelTransaction;
                    //if (DataModelTransaction.transactionTable.TryGetValue(localIdentifier, out dataModelTransaction))
                    //{
                    //    dataModelTransaction.SqlConnection.Close();
                    //    DataModelTransaction.transactionTable.Remove(localIdentifier);
                    //}
                }
                finally
                {
                    global::System.Threading.Monitor.Exit(DataModelTransaction.syncRoot);
                }
            }
        }
Ejemplo n.º 5
0
 public void BuildCommand(
     global::System.Data.SqlClient.SqlCommand command,
     global::System.Data.SqlClient.SqlConnection connection)
 {
     if (ReferenceEquals(command, null))
     {
         throw new global::System.ArgumentNullException(nameof(command));
     }
     if (ReferenceEquals(connection, null))
     {
         throw new global::System.ArgumentNullException(nameof(connection));
     }
     this.BuildCommand(command);
     command.Connection = connection;
 }
Ejemplo n.º 6
0
    public partial global::SomeType WithEncryptionSystemSql(global::System.Data.SqlClient.SqlConnection connection, int id, string name)
    {
        // locals
        global::System.Data.SqlClient.SqlCommand?   __dapper__command = null;
        global::System.Data.SqlClient.SqlDataReader?__dapper__reader  = null;
        bool __dapper__close = false;

        int[]? __dapper__tokenBuffer = null;
        try
        {
            // prepare connection
            if (connection !.State == global::System.Data.ConnectionState.Closed)
            {
                connection !.Open();
                __dapper__close = true;
            }

            // prepare command (excluding parameter values)
            if ((__dapper__command = global::System.Threading.Interlocked.Exchange(ref s___dapper__command_Samples_CustomOptions_input_cs_WithEncryptionSystemSql_8, null)) is null)
            {
                __dapper__command = __dapper__CreateCommand(connection !);
            }
            else
            {
                __dapper__command.Connection = connection;
            }

            // assign parameter values
#pragma warning disable CS0618
            __dapper__command.Parameters[0].Value = global::Dapper.Internal.InternalUtilities.AsValue(id);
            __dapper__command.Parameters[1].Value = global::Dapper.Internal.InternalUtilities.AsValue(name);
#pragma warning restore CS0618

            // execute reader
            const global::System.Data.CommandBehavior __dapper__behavior = global::System.Data.CommandBehavior.SequentialAccess | global::System.Data.CommandBehavior.SingleResult | global::System.Data.CommandBehavior.SingleRow;
            __dapper__reader = __dapper__command.ExecuteReader(__dapper__close ? (__dapper__behavior | global::System.Data.CommandBehavior.CloseConnection) : __dapper__behavior);
            __dapper__close  = false;            // performed via CommandBehavior

            // process single row
            global::SomeType __dapper__result;
            if (__dapper__reader.HasRows && __dapper__reader.Read())
            {
                __dapper__result = global::Dapper.TypeReader.TryGetReader <global::SomeType>() !.Read(__dapper__reader, ref __dapper__tokenBuffer);
            }
            else
            {
                __dapper__result = default !;
Ejemplo n.º 7
0
        private void UniversalDashboardDeviceType_Load(object sender, EventArgs e)
        {
            SqlConnection dbConnection4;     //Connection for contractIdCommand
            SqlCommand    contractIdCommand; // Select query to get thresholds by deviceType.
            {
                //Open contract id for deviceTypeControl and thresholdId
                dbConnection4 = new global::System.Data.SqlClient.SqlConnection();
                dbConnection4.ConnectionString = global::LinqExample.Properties.Settings.Default.SLA_RT_monitoringConnectionString;

                // Used for having contract ID per  threshold_id and  device_type
                contractIdCommand = new SqlCommand(
                    @"SELECT threshold_id "
                    + @"FROM [dbo].[SlaContracts] "
                    + @"WHERE device_type=@device_type ",
                    dbConnection4);

                if (((contractIdCommand.Connection.State & global::System.Data.ConnectionState.Open)
                     != global::System.Data.ConnectionState.Open))
                {
                    contractIdCommand.Connection.Open();
                }

                contractIdCommand.CommandType = global::System.Data.CommandType.Text;
                contractIdCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@device_type", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "device_type", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
                contractIdCommand.Parameters["@device_type"].Value = this.DeviceTypeText;
            }

            SqlDataReader reader2 = contractIdCommand.ExecuteReader();

            // Add thresholdIds to the list of matching trhresholds.
            while (reader2.Read())
            {
                listThresholds.Add(reader2.GetInt32(0));
            }

            reader2.Close();                   //close the reader when not using.
            SqlConnection dbConnection;        // connections for deviceByTypeCommand
            SqlCommand    deviceByTypeCommand; // select id and name from Devices table by deviceType.


            dbConnection = new global::System.Data.SqlClient.SqlConnection();
            dbConnection.ConnectionString = global::LinqExample.Properties.Settings.Default.SLA_RT_monitoringConnectionString;

            // Used for having all the information per Device type
            deviceByTypeCommand = new SqlCommand(
                @"SELECT id, name "
                + @"FROM [dbo].[Devices] "
                + @"WHERE type = @device_type ",
                dbConnection);

            global::System.Data.ConnectionState previousConnectionState = deviceByTypeCommand.Connection.State;
            if (((deviceByTypeCommand.Connection.State & global::System.Data.ConnectionState.Open)
                 != global::System.Data.ConnectionState.Open))
            {
                deviceByTypeCommand.Connection.Open();
            }

            deviceByTypeCommand.CommandType = global::System.Data.CommandType.Text;
            deviceByTypeCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@device_type", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "device_type", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));

            deviceByTypeCommand.Parameters["@device_type"].Value = this.DeviceTypeText;
            SqlDataReader reader = deviceByTypeCommand.ExecuteReader();

            int i = 0;

            while (reader.Read())
            {
                // Init deviceData with query result.
                SingleDeviceData newDeviceData = new SingleDeviceData(reader.GetInt32(0), reader.GetString(1));

                //Create a label for this device.
                Label deviceLabel = new Label();

                // arrange labels in a row. Left to right.
                deviceLabel.Location = new Point((int)(40 + 65 * (i * 1.2)), 35);
                deviceLabel.Size     = new System.Drawing.Size(60, 60);

                // Change the shape of the label to a circle.
                var path = new System.Drawing.Drawing2D.GraphicsPath();
                path.AddEllipse(0, 0, deviceLabel.Width, deviceLabel.Height);
                deviceLabel.Region = new Region(path);

                // get the needed backcolor by ioncidents data
                deviceLabel.BackColor = GetColorByIncidentsNumber(newDeviceData.deviceId);
                deviceLabel.TextAlign = ContentAlignment.TopCenter;

                // Put the text on the label.
                deviceLabel.Text     += SplitName(newDeviceData.deviceName)[0];
                deviceLabel.Text     += "\n";
                deviceLabel.Text     += SplitName(newDeviceData.deviceName)[1];
                deviceLabel.Text     += "\n";
                deviceLabel.TextAlign = ContentAlignment.MiddleCenter;
                try
                {
                    if (SplitName(newDeviceData.deviceName)[2] != null)
                    {
                        deviceLabel.Text += SplitName(newDeviceData.deviceName)[2];
                    }
                }
                catch { }

                // Insert device data in the Tag property ( for using on Click event and updateTimer).
                deviceLabel.Tag    = newDeviceData;
                deviceLabel.Cursor = Cursors.Hand;
                deviceLabel.Click += x_Click;

                //Add to form controls.
                this.Controls.Add(deviceLabel);
                ++i;
            }
            reader.Close();
            //Update incidents every interval.
            updateTimer.Start();
        }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::WaldenReports.Properties.Settings.Default.walden;
 }
Ejemplo n.º 9
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=.;Initial Catalog=Hotel_data;User ID=sa;Password=123456";
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=192.168.0.104,1433;Initial Catalog=TranspoartSystem;Persist Security " +
         "Info=True;User ID=myt;Password=xiaoyuemian;";
 }
Ejemplo n.º 11
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=DESKTOP-733PMIV;Initial Catalog=FaceDatabase;Integrated Security=True" +
                                         "";
 }
Ejemplo n.º 12
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Denisenko.Cutting.Optimizing.Properties.Settings.Default.CutOptimaConnectionString;
 }
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=BODEXPRESS.mssql.somee.com;Initial Catalog=BODEXPRESS;User ID=bodex;P" +
                                         "assword=bodexpress";
 }
Ejemplo n.º 14
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = ValidacionSeguridad.Instance.GetApplicationConnectionString();
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::DataWizInConsoleTest.Properties.Settings.Default.test_oneConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::LiquiForce.LFSLive.DA.Projects.Properties.Settings.Default.Live1ConnectionString;
 }
Ejemplo n.º 17
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Groop.IntegrationTests.Properties.Settings.Default.CRinetaConnectionString3;
 }
Ejemplo n.º 18
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = CONNECT_STR;
 }
Ejemplo n.º 19
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::VehicleManagementSystem.Properties.Settings.Default.VehiclePurchaseManagementsConnectionString;
 }
Ejemplo n.º 20
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::ReportFromSqlServer.Properties.Settings.Default.example_dbConnectionString;
 }
Ejemplo n.º 21
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::PakTurk_school_system.Properties.Settings.Default.School_SystemConnectionString1;
 }
Ejemplo n.º 22
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::西子新能源.Properties.Settings.Default.EnergyTestingConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::WaterOneFlow.odm.v1_0.Properties.Settings.Default.od_1_0ConnectionString;
 }
Ejemplo n.º 24
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::FacSync.Properties.Settings.Default.CareCentralSync_PConnectionString;
 }
Ejemplo n.º 25
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::TerraScan.BusinessEntities.Properties.Settings.Default.T2TerraScanConnectionString;
 }
 private void InitConnection() {
     _connection = new global::System.Data.SqlClient.SqlConnection();
     Settings settings = new Settings();
     _connection.ConnectionString = settings.GetConnectionString();
 }
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::DGP.Entities.Properties.Settings.Default.dgpConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=SERVER1\\SQLEXPRESS;Initial Catalog=walden;Integrated Security=True";
 }
Ejemplo n.º 29
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::ACMS.Properties.Settings.Default.ACMSConnectionString;
 }
Ejemplo n.º 30
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["CodematicConnectionString1"].ConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["AdventureWorksConnectionString"].ConnectionString;
 }
							[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]private void InitConnection()
							{
								this._connection = new global::System.Data.SqlClient.SqlConnection();
								this._connection.ConnectionString = global::SoftLogik.Win.My.Settings.Default.DBConnection;
							}
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::HumanResourceUpdate.Properties.Settings.Default.wims_qlnsConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=192.168.1.5,1433;Initial Catalog=TranspoartSystem;User ID=test;Passwo" +
         "rd=64293849;";
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::GUIConceptsPart2.Properties.Settings.Default.northwindConnectionString;
 }
Ejemplo n.º 36
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::WaterOneFlow.odm.v1_0.Properties.Settings.Default.od_1_0ConnectionString;
 }
Ejemplo n.º 37
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Hotel_app.Properties.Settings.Default.Hotel_dataConnectionString;
 }
Ejemplo n.º 38
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=.\\samsvx;Initial Catalog=TmpDB;User ID=sa;Password=3919";
 }
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::new_project_dbms.Properties.Settings.Default.testing;
 }
Ejemplo n.º 40
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=FTEESW520\\SQL2008R2;Initial Catalog=EEIMonitor;Integrated Security=Tr" +
                                         "ue;";
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=db113.72dns.net;Initial Catalog=db_rfidtest;Persist Security Info=Tru" +
         "e;User ID=rfidtest;Password=123456;";
 }
Ejemplo n.º 42
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = "Data Source=desktop-mu5f7e3;Initial Catalog=BankingApp;Integrated Security=True";
 }
Ejemplo n.º 43
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Moteur.Properties.Settings.Default.BdMoteurInferanceConnectionString;
 }
Ejemplo n.º 44
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Granity.granityMgr.Properties.Settings.Default.SmartCardConnectionString;
 }
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["PharmacyToolConnectionString"].ConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::CodeGenerator.Properties.Settings.Default.MenuMasterConnectionString;
 }
Ejemplo n.º 47
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::SchoolManagement.Properties.Settings.Default.itecschoolConnectionString;
 }
Ejemplo n.º 48
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["BI_CustomerFlowConnectionString"].ConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Tests.Unit.Lender.Slos.Database.Properties.Settings.Default.Lender_SlosConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::EDocuments.Properties.Settings.Default.DocumentsBetta2ConnectionString;
 }
Ejemplo n.º 51
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Biruni.Shared.Properties.Settings.Default.dbInventoryConnectionString;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::IPCOREDS.Properties.Settings.Default.TOS_TicketSystemConnectionString;
 }
Ejemplo n.º 53
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Granity.granityMgr.Properties.Settings.Default.SmartCardConnectionString;
 }
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::MaterialCore.Properties.Settings.Default.CoreConnectionString;
 }
Ejemplo n.º 55
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::Equipment_Manager.Properties.Settings.Default.Equipment_ManageConnectionString;
 }
Ejemplo n.º 56
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::COPR_BE.Properties.Settings.Default.COPR_DevNewConnectionString;
 }
Ejemplo n.º 57
0
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::个人财产管理系统.Properties.Settings.Default.个人资产数据库ConnectionString1;
 }
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::LoanApplication.Properties.Settings.Default.DB_LoanApplicationConnectionString;
 }
Ejemplo n.º 59
0
 private void InitConnection() {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::com.Omei.DLL.Properties.Settings.Default.OmeiTravelConnectionString;
 }
 private void InitConnection()
 {
     this._connection = new global::System.Data.SqlClient.SqlConnection();
     this._connection.ConnectionString = global::RepStoredProc.Properties.Settings.Default.NorthwindConnectionString;
 }