By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,167 Members | 1,591 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,167 IT Pros & Developers. It's quick & easy.

Problem while retrieving multiple item in checkboxlist

P: 6
I cant retrieve selected item from checkboxlist in asp.net project.
when i submit multiple item from checkboxlist it works fine. but when i am trying to edit this items then checkboxlist does not select the previous values that i have selected.It only selects one item. my code which i am using for edit is following:
Dim _drArticle As SqlDataReader
_drArticle = SqlHelper.ExecuteReader(ConfigurationSettings.AppS ettings("ConnectionString"), _
CommandType.Text, _
"SELECT *FROM MST_ACCESS WHERE MA_MUT_ID=" & CInt(Request.QueryString("ArtID")))



If _drArticle.HasRows Then

_drArticle.Read()
On Error Resume Next
'checkboxlist1.SelectedValue = _drArticle("MA_MUR_ID")

Dim i As Integer
For i = 0 To checkboxlist1.Items.Count - 1
If checkboxlist1.Items(i).Selected = True Then
checkboxlist1.Items(i).Value = _drArticle("MA_MUR_ID")
checkboxlist1.SelectedValue = checkboxlist1.Items(i).Value

End If
Next
end if
Jan 17 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.