B
Big E
I'm using ASP.Net and SQL Server.
I have a listbox looks up data from a table and fills the listbox.
I have a stored procedure that looks up the selected values and tries to
show them as selected in the listbox. My FOR NEXT LOOP gets stuck on one
record in the datatable. There are 4 records in the datatable and only the
first one is selected. It never moves past the first record.
MyCommand.Fill(dsCom, "tblCommRealtorAssociation")
dtCom = dsCom.Tables("tblCommRealtorAssociation")
Dim i As Integer
For i = 0 To dtCom.Rows.Count - 1
lstCommunities.SelectedValue =
dsCom.Tables("tblCommRealtorAssociation").Rows(0)("CommunityID")
Next
I have a listbox looks up data from a table and fills the listbox.
I have a stored procedure that looks up the selected values and tries to
show them as selected in the listbox. My FOR NEXT LOOP gets stuck on one
record in the datatable. There are 4 records in the datatable and only the
first one is selected. It never moves past the first record.
MyCommand.Fill(dsCom, "tblCommRealtorAssociation")
dtCom = dsCom.Tables("tblCommRealtorAssociation")
Dim i As Integer
For i = 0 To dtCom.Rows.Count - 1
lstCommunities.SelectedValue =
dsCom.Tables("tblCommRealtorAssociation").Rows(0)("CommunityID")
Next