• I would check two things.

    1. Verify the connection string. Make sure the database your using in VS2010 is the sames one your application is pointed to. Very often this is easily glanced at but not REALLY checked.

    2. Make sure the dll references you have in your project are the same version as your database. You don't want to have v3.0 dll's trying to access a 3.5 database.

    Can the C# application run other queries?

    What if you run the query from SSMS and not VS2010?