Beispiel #1
0
 public MSSQLCommand(MSSQLConnection conn, string cmdText, CommandType cmdType, int?timeoutOverride)
 {
     _cmd = new SqlCommand(cmdText, conn.CurrentConnection)
     {
         CommandType    = cmdType,
         CommandTimeout = timeoutOverride.GetValueOrDefault(Globals.CommandTimeoutSeconds.GetValueOrDefault(conn.CurrentConnection.ConnectionTimeout)),
         Transaction    = conn.CurrentTransaction
     };
 }
        public MSSQLCommand(MSSQLConnection conn, string cmdText, CommandType cmdType, int?timeoutOverride)
        {
            if (conn.CurrentConnection == null)
            {
                throw new CEFInvalidStateException(InvalidStateType.SQLLayer, "CurrentConnection is not set.");
            }

#pragma warning disable CA2100 // Review SQL queries for security vulnerabilities
            _cmd = new SqlCommand(cmdText, conn.CurrentConnection)
            {
                CommandType    = cmdType,
                CommandTimeout = timeoutOverride.GetValueOrDefault(Globals.CommandTimeoutSeconds.GetValueOrDefault(conn.CurrentConnection.ConnectionTimeout)),
                Transaction    = conn.CurrentTransaction
            };
#pragma warning restore CA2100 // Review SQL queries for security vulnerabilities
        }