Error 'Cannot Convert double to int' : <p>I have what seems to me as a weird issue with my code. I have a method that performs a simple query and returns the result. I'm trying to return the value as a double but I get an error:</p>

<blockquote>
  <p>CS0266    Cannot implicitly convert type 'double' to 'int'. An explicit
  conversion exists (are you missing a cast?)</p>
</blockquote>

<p>I'm not trying to do any conversions so I don't understand what the issue is.
Here is the calling code:</p>

<pre><code>  double displacement = sqLite.GetDisplacement( transItem.Item.Name );
</code></pre>

<p>and here is the code that is called:</p>

<pre><code>public int GetDisplacement( string item )
{
    double dDisposition = 0;
    string sSql = "SELECT [Displacement] FROM [Items] WHERE [Name] = '" + item + "';";

    using ( var dbConnection = new SQLiteConnection( sConnectionString ) )
    {
        try
        {
            dbConnection.Open();
            SQLiteCommand cmd = new SQLiteCommand( sSql, dbConnection );
            object result = cmd.ExecuteScalar();

            dDisposition = Convert.ToDouble( result );

        }
        catch ( Exception e )
        {
            MessageBox.Show( "Error retreiving displacement information: " + e.ToString() );
        }

    }

    return dDisposition; // This is where I get the error

}
</code></pre>

<p>I'm not trying to convert anything, everything is declared as a double. I've tried to clean and rebuild the solution several times to no avail. What am I missing?</p>
