Azavea.Open.DAO.SQL.SqlUtilities.FindParameterPlaceholders C# (CSharp) Method

FindParameterPlaceholders() public static method

All SQL strings generated by FastDAO use ? as the parameter placeholder. For a database that needs another format, an AbstractSqlConnectionDescriptor subclass needs to swap the ?s out with something else. This helper
Thrown if the command is not CommandType.Text.
public static FindParameterPlaceholders ( IDbCommand command ) : int[]
command IDbCommand The command whose text should be searched for ? characters.
return int[]
        public static int[] FindParameterPlaceholders(IDbCommand command)
        {
            if (command.CommandType != CommandType.Text)
            {
                throw new ArgumentException("Cannot search for parameter placeholders unless the type of the command is CommandType.Text.");
            }
            return FindParameterPlaceholders(command.CommandText);
        }

Same methods

SqlUtilities::FindParameterPlaceholders ( string sql ) : int[]