Question: Query always return -1 don't know why. Will someone please explain. Value of count always remains -1.

```
string query = "SELECT COUNT(*) AS Emails FROM users";

using (SqlConnection connection = new SqlConnection(connectionString))
{
    SqlCommand command = new SqlCommand(query, connection);
    command.Parameters.AddWithValue("@email", email);

    try
    {
       connection.Open();
       count = command.ExecuteNonQuery();

       if (count > 0)
          return "Something Wrong1";
    }
    catch
    {
       return "Something Wrong2";
    }

    return count + "Every thing ok";
 }

```

Answer: 
I think that perhaps what you mean is for your SQL statement to be:

```
SELECT COUNT(*) FROM users WHERE Email = @email

```

Besides that, you must use the `ExecuteScalar` method to retrieve the count.
I'm no C# expert, but that `command.ExecuteNonQuery()` doesn't seem right ... it's a *query* after all!