I have a dropdown list that fills correctly when I first create the datatable with the first pull of data for a locatioin.
When I go back and choose a different location, it still is holding the original data from the first pull.
Here is the dropdownlist definition:
Here is the code that creates the table.
I am not sure what needs to change.
Any help would be greatly appreciated.
Eddi Rae
When I go back and choose a different location, it still is holding the original data from the first pull.
Here is the dropdownlist definition:
Code:
<asp:DropDownList ID="ddlSalesPersonSearch"
runat="server" AppendDataBoundItems="True" BackColor="#F7B432"
CssClass="ColHeading" Width="150px" AutoPostBack="True">
<asp:ListItem Value="0">ALL</asp:ListItem>
</asp:DropDownList>
Code:
If Session("Loc_No") <> Nothing Then
If Session("usrIsAdmin") = "True" Then
'strFilter = ""
strFilter2 = "locations like '%" & Session("Loc_No") & "%'"
ElseIf Session("usrIsfhAdmin") = "True" Then
strFilter2 = "locations like '%" & Session("Loc_No") & "%'"
Else
strFilter2 = "username = '" & Session("usrName") & "'"
End If
End If
strSQL = "select id from NavCare_Security where " & strFilter2 & " order by id"
Dim da As New SqlDataAdapter(strSQL, MyConn)
Dim ds As New DataSet
ds.Dispose()
da.Fill(ds, "SalesPerson")
da.Dispose()
With ddlSalesPersonSearch
.DataSource = ds.Tables("SalesPerson")
.DataMember = "id"
.DataTextField = "id"
.SelectedIndex = 0
End With
ddlSalesPersonSearch.DataBind()
Any help would be greatly appreciated.
Eddi Rae