Npgsql.NpgsqlCommand.ExecuteBlind C# (CSharp) Method

ExecuteBlind() static private method

Internal query shortcut for use in cases where the number of affected rows is of no interest.
static private ExecuteBlind ( NpgsqlConnector connector, byte command, int timeout = 20 ) : void
connector NpgsqlConnector
command byte
timeout int
return void
        internal static void ExecuteBlind(NpgsqlConnector connector, byte[] command, int timeout = 20)
        {
            // Bypass cpmmand parsing overhead and send command verbatim.
            ExecuteBlind(connector, NpgsqlQuery.Create(connector.BackendProtocolVersion, command), timeout);
        }

Same methods

NpgsqlCommand::ExecuteBlind ( NpgsqlConnector connector, NpgsqlQuery query, int timeout ) : void
NpgsqlCommand::ExecuteBlind ( NpgsqlConnector connector, string command, int timeout = 20 ) : void

Usage Example

Beispiel #1
0
        /// <summary>
        /// This method is responsible to release all portals used by this Connector.
        /// </summary>
        internal void ReleasePlansPortals()
        {
            Int32 i = 0;

            if (_planIndex > 0)
            {
                for (i = 1; i <= _planIndex; i++)
                {
                    try
                    {
                        //Query(new NpgsqlCommand(String.Format("deallocate \"{0}\";", _planNamePrefix + i), this));
                        using (NpgsqlCommand cmd = new NpgsqlCommand(String.Format("deallocate \"{0}\";", _planNamePrefix + i.ToString()), this))
                        {
                            cmd.ExecuteBlind();
                        }
                    }

                    // Ignore any error which may occur when releasing portals as this portal name may not be valid anymore. i.e.: the portal name was used on a prepared query which had errors.
                    catch (Exception) {}
                }
            }

            _portalIndex = 0;
            _planIndex   = 0;
        }
All Usage Examples Of Npgsql.NpgsqlCommand::ExecuteBlind