I stedet for command.ExecuteNonQuery(); du skal ringe Object res = command.ExecuteScalar(); Console.WriteLine(res);