Hello everyone,
I am querying an MS Access database to find duplicate records and list the results in descending order. I am using a 'while' loop to read through the records but I'm finding it difficult to store the results in separate variables, i.e. the query finds three results where the first duplicate record is found 5 times, the second is found 3 times and the third is found once. I would like to display these 3 records on a form in descending order however I connot display them separately - they display as one string. Can anyone help me to display them separately? Here is my code:
OleDbCommand QueryString1 = new OleDbCommand("SELECT User, text2, Count(User) AS CountOfUser FROM Table1 GROUP BY User, text2 HAVING (((User)='Ann') AND ((text2) Like '%Manager%')) ORDER BY Count(User) DESC", QueryCon1);
OleDbDataReader readerQ1;
try
{
QueryCon1.Open();
readerQ1 = QueryString1.ExecuteReader();
while (readerQ1.Read())
{
txtResult.Text += (readerQ1["text2"].ToString()) + " ";
}
Thanks in advance,
SubProf