You call ExecuteNonQuery- but this is a request! Your line does not affect the lines because it is just a request. You need to put the counting part in the request, for example:
select count(*) from x_table where column1 = 5
And then the easiest way to get the result is to use ExecuteScalar:
int count = (int) command.ExecuteScalar();
, ExecuteScalar .