Are you iterating over the results? If not then the query will not run.
You should use Fetch
instead Query
as Query
runs the query only when you start iterating over the results.
public IEnumerable<Stock> GetRandomStock(int number)
{
Database db = new Database("MyCS");
var sql = "SELECT TOP @0 * FROM Stock ORDER BY NEWID()";
var results = db.Fetch<Stock>(sql, number);
return results;
}