Every time I try to get my program to count how many entries there are in the database, it keeps returning -1. I don't know how to fix that. Here is my code:
string sqlth = "SELECT COUNT(PatientID) FROM Patient";
SqlCommand exeSqlth = new SqlCommand(sqlth, cn);
cn.Open();
int y = exeSqlth.ExecuteNonQuery();
I want y to equal the count.
Go to the complete details ...