state - check the connection status
give back the number of the selected rows