var temp = ConfigurationManager.ConnectionStrings["connectionStr"].ConnectionString;
conn = new SqlConnection(temp);
conn.Open();
// Create the command
SqlCommand command = new SqlCommand("SELECT * FROM View_Patients", conn);
command.Connection = conn;
RecCount = Convert.ToInt32(command.ExecuteScalar());
last line giving the error "Input String was not in a correct format"

Nitin SontakkeRank #264 · 9.6K reputationPosted Jun 1, 2018, 9:23 PM EDT
Rafnas T PRank #280 · 8.8K reputationPosted Jun 1, 2018, 10:45 PM EDT