Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 24, 2008 08:53 PM by kcrewjap
Jun 23, 2008 08:56 PM|LINK
Yes for as long as you enclose it with double quotes..
Jun 23, 2008 09:01 PM|LINK
Cannot implicitly convert type 'string' to 'bool' ???
Jun 23, 2008 09:12 PM|LINK
My bad.. you need to use == signs when comparing two string values .. so have it this way below
if (cblMembersAssigned.Items[i].Text ==
"1, 2, 3, 4, 5, 6")
Jun 23, 2008 09:16 PM|LINK
okay.. now it succeeds when i build it. however im not sure the whole item.add is the right choice here as when i run the tool im building and select a projectname from the dropdown. everything is populated accept i the cbl, it adds another checkbox with
the values from teh database (i.e. 1, 3, 4, 5 ,6) instead of checking the boxes..
is cblMembersAssigned.Items.Add(dt.Rows["AssignedMembers"].ToString()); correct? or should this line be taken out since we are using the for loop?
Jun 23, 2008 09:31 PM|LINK
I think I'm lost here.. Actually I'm confused.. Does your CheckBoxList has already a values in it? Cause if it does not then you can't compare anything from your CBL.. But if your CBL has already an items on it then you can remove this line below and compare
it directly to the values of database and do the checking after..
Jun 23, 2008 09:32 PM|LINK
oh im sorry.. yes. my cbl already has 6 static checkboxes in it. each is a name of the member, so i dont need to add anymore.. does that help?
Jun 23, 2008 09:42 PM|LINK
Jun 23, 2008 09:44 PM|LINK
so once you do the comparison. how do you make the checkboxes either be checked or unchecked? right nwo the code looks like this:
txtDate.Text = dt.Rows[
txtProjectName.Text = dt.Rows[
Jun 23, 2008 10:31 PM|LINK
also. shoudl i use the split function since the data comming from the database column is comma delimited? if so where?
Jun 23, 2008 10:46 PM|LINK
string member = dt.Rows["AssignedMembers"].ToString();
string splitMember = member.Split(',');
for (int i=0; i <cblMembersAssigned.Items.Count; i++)
if (cblMembersAssigned.Items[i].Text == splitMember[i].ToString())
cblMembersAssigned.Items[i].Selected = true;