While loop repeating rows

Hey,

I have the following code:


        ///////////////////// V A C A N C I E S //////////////////////////////

        string connVac = "...";
        SqlConnection dbConnVac = new SqlConnection(connVac);

        DataSet dsInfo = new DataSet();

        string sqlVac1 = "Select distinct job_name from tbl_vacancies Where (availability = 'Live')";
        string sqlVac2 = "select tbl_vacancies.job_id, tbl_vacancies.job_name, tbl_vacancies.location, tbl_vacancies.location as Region, " +
        "max(tbl_job_titles.body) as theDetails from tbl_vacancies, tbl_job_titles where tbl_vacancies.availability = 'Live' AND " +
        "tbl_vacancies.job_name = tbl_job_titles.name Group by tbl_vacancies.job_id, tbl_vacancies.job_name, tbl_vacancies.location, tbl_job_titles.body";
        dbConnVac.Open();

        SqlCommand dbVac = new SqlCommand(sqlVac1, dbConnVac);
        SqlDataAdapter adapter = new SqlDataAdapter();

        adapter.SelectCommand = dbVac;
        adapter.Fill(dsInfo, "Jobs");

        dbVac = new SqlCommand(sqlVac2, dbConnVac);

        adapter = new SqlDataAdapter();
        adapter.SelectCommand = dbVac;
        adapter.Fill(dsInfo, "JobDetails");

        dbConnVac.Close();

        int ocount = 0;
        int icount = 0;

        string jobname = "";

        for (ocount = 0; ocount < dsInfo.Tables["Jobs"].Rows.Count; ocount++)
        {
            Label2.Text += "<div id='vacancies'>" +
                    "<p><strong>" + dsInfo.Tables["Jobs"].Rows[ocount]["job_name"].ToString() + "</strong></p>";
            jobname = dsInfo.Tables["Jobs"].Rows[ocount]["job_name"].ToString().ToLower();

            for (icount = 0; icount < dsInfo.Tables["JobDetails"].Rows.Count; icount++)
            {
                if (jobname == dsInfo.Tables["JobDetails"].Rows[icount]["job_name"].ToString().ToLower())
                {
                    Label2.Text += "<div class='vacancy-info'><p>" + dsInfo.Tables["JobDetails"].Rows[icount]["theDetails"].ToString() + "</p><br/>" +
                "<span>" + dsInfo.Tables["JobDetails"].Rows[icount]["Region"].ToString() + "</span>" +
                    "</div>";
                }
            }
            Label2.Text += "</div>";
        }

I am trying to display Vacancies for jobs with the relevant job description. The job description (theDetails) is situated in tbl_job_titles.

Now what is happening is when i loop through the job description is displayed again and again the more vacancies there are…

Take a look at this page:

http://kidsunlimited.co.uk/vacancies_test.aspx

If you look at the job “Cook” there should only be one description but there is two…

If you look at the first job “Administrator” it displays perfectly, which is because there is only the one vacancy in “Bickley - Bickley - Kent”, so the problem is when there is more than one…

How can i fix this?

Can anyone help?

Thanks