I have following code in VS2008
If Linq.Enumerable.Contains(Of String)(selectedUsersRoles, RoleCheckBox.Text) Then
RoleCheckBox.Checked = True
Else
RoleCheckBox.Checked = False
End If
I need the above code in VS2005
What can i do instead of linq in above code? Can anybody help?
If you don’t wish to alter the RoleCheckBox.Checked twice (when str is actually found) then declare a boolean flag (i.e. boolFound) with an initial False value, change it to true when found, and asign RoleCheckBox.Checked = boolFound after the “for each” loop….