Not sure if this is the problem in your case, but you should always check the result of Read (). eg,
if (myReader.Read()) { statement = myReader.GetString(0); }
Edit: What you are actually doing is getting a scalar, and you can use ExecuteScalar ()
return (myCommand.ExecuteScalar() ?? string.Empty).ToString();
source share