コード例 #1
0
ファイル: MsSqlDataCommand.cs プロジェクト: orzMaster/L2.Net
        /// <summary>
        ///  Prepares current <see cref="MsSqlDataCommand"/> to execute.
        /// </summary>
        /// <param name="connection"><see cref="MsSqlDataConnection"/> to use.</param>
        internal void Prepare(ref MsSqlDataConnection connection)
        {
            m_Connection      = connection;
            m_Connection.Idle = false;

            m_Command             = new SqlCommand(m_CommandText, connection.SqlServerConnection);
            m_Command.CommandType = m_CommandType;

            if (m_Parameters != null)
            {
                m_Command.Parameters.AddRange(m_Parameters);
            }

            m_Command.Prepare();
        }
コード例 #2
0
        /// <summary>
        /// Start lazy cache dump <see cref="Thread"/>.
        /// </summary>
        /// <param name="q"><see cref="MsSqlDataCommand"/> objects array.</param>
        private void LazyQueue_DumpHandlerThread( object q )
        {
            MsSqlDataConnection connection = new MsSqlDataConnection(this, byte.MaxValue, true);

            MsSqlDataCommand[] queue = ( MsSqlDataCommand[] )q;

            for ( int i = 0; i < queue.Length; i++ )
            {
                MsSqlDataCommand msdc = queue[i];

                SetConnection(ref msdc, connection);

                msdc.ExecuteNonQuery();

                ReleaseCommand(msdc);
            }

            queue = null;

            connection.Close(false);
            connection.Dispose();
            connection = null;
        }
コード例 #3
0
 /// <summary>
 /// Sets <see cref="MsSqlDataConnection"/> reference to provided <see cref="MsSqlDataCommand"/> object and prepares it.
 /// </summary>
 /// <param name="msdc"><see cref="MsSqlDataCommand"/> object.</param>
 /// <param name="connection"><see cref="MsSqlDataConnection"/> to reference.</param>
 private static void SetConnection( ref MsSqlDataCommand msdc, MsSqlDataConnection connection )
 {
     msdc.Prepare(ref connection);
 }