Is it possible to overload a method this way?
<p>I am trying to allow people to login using their UserID(int) or their username (string).  The way I thought about doing this is creating two seperate methods, one that accepts a string, and one that accepts an int.  But I could not get this to work and it seems there might be a better solution.</p>

<pre><code>public static string ForgotPassword ( string username )
{
    using ( var conn = new SqlConnection( GetConnectionString() ) )
    using ( var cmd = conn.CreateCommand() )
    {
        conn.Open();
        cmd.CommandText =
        @"SELECT 
             Password 
         FROM 
             Distributor
         WHERE 
             Username = @username";
        cmd.Parameters.AddWithValue( "@username", (string)username );
        using ( var reader = cmd.ExecuteReader() )
        {
            if ( !reader.Read() )
            {
                // no results found
                return null;
            }
            return reader.GetString( reader.GetOrdinal( "Password" ) );
        }
    }
}

public static string ForgotPassword ( int username )
{
    using ( var conn = new SqlConnection( GetConnectionString() ) )
    using ( var cmd = conn.CreateCommand() )
    {
        conn.Open();
        cmd.CommandText =
        @"SELECT 
             Password 
         FROM 
             Distributor
         WHERE 
             DistributorID= @username";
        cmd.Parameters.AddWithValue( "@username", (int)username );
        using ( var reader = cmd.ExecuteReader() )
        {
            if ( !reader.Read() )
            {
                // no results found
                return null;
            }
            return reader.GetString( reader.GetOrdinal( "Password" ) );
        }
    }
}
</code></pre>

<p>What is the best way to allow them to login with a user_id or a username?</p>
