I have a datarepeater that displays data based on the faculty selected from a combo box. All works fine with the very first selected faculty. When making a second faculty (or third, fourth...) is selected, the data just tacks on to the bottom to the bottom of the first. So if faculty #1 is selected, all of their data displays in the datarepeater. Then if faculty #2 is selected, all of faculty #1 is still displayed and faculty #2 is displayed at the end.
Here's the code I use to bind the datarepeater and clear the datarepeater between faculty
selections. I'm sure it's somethingvery simple that I'm doing wrong and would appreciate some help or advice. Thanks.
If cboFaculty.ValueMember <> "" And Not cboFaculty.SelectedValue Is Nothing Then
DataRepeater1.BeginResetItemTemplate()
For Each ctrl As Control In DataRepeater1.ItemTemplate.Controls
If TypeOf ctrl Is Label Then
CType(ctrl, Label).DataBindings.Clear()
CType(ctrl, Label).Text = ""
End If
Next
strSQL = "SELECT * FROM tblCMEHours WHERE ID = " & cboFaculty.SelectedValue
da = New SqlDataAdapter(strSQL, conn)
da.Fill(dt)
bs.DataSource = dt
DataRepeater1.EndResetItemTemplate()
DataRepeater1.DataSource = bs
End If