I need to query a database of application titles and count the instances of each title. I've already got a list<string> of distinct values from a previous query, and now I need to count how many times each value occurs. I'm not sure if the query is correct, or how to handle the output. So far I have:

SqlCommand appCommand = new SqlCommand("select count(title) from poss_titles where title = @thisTitle", appConnection);
                appCommand.Parameters.AddWithValue("@thisTitle", cands[i]);
                SqlDataReader reader;
                reader = appCommand.ExecuteReader();

Edited by benkyma: n/a

Votes + Comments
Duplicate posts
8 Years
Discussion Span
Last Post by benkyma
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.