7 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SreekanthPosted Nov 21, 2009, 6:27 AM
Kirtan PatelPosted Nov 21, 2009, 5:52 AM
its now possible to Have Web Like two things ( Value and Text ) property both but you can do
this thing by
Program a Method that will Provide you ID from database When you pass the Name
like
public int GetIDFromName(string Name)
{
//Connect to database
//get the ID From Database using SQL "Where Query"
return ID;
}
SreekanthPosted Nov 21, 2009, 12:47 AM
how can i do this...kirtan i thnk u got ma question, in web appl. its easy to get
checklistbox values....but how can i doth same in web.
i have two tables one for company other 4 products.
In page load of my WINDOWS FORM , i filled my company in the chedkedLISTboxCOMPANY... and products in 2nd chekedlistboxPRODUCT.
FOR chedkedLISTboxCOMPANY,box ,valueMember is countryid and Dispaly Memeber is countryname.............
for chekedlistboxPRODUCT ,i this alos Valumemebr is productid and dispalymemebr is product name...
here companyid is d pK of companymaster and productid PK of productmaster table....
now wat i nedd is userselects multiple company and multiple products , i want toinsert each company and produts row by row....( sql part, cmplted)....
and my 3r table conatins.. id(PK),companyid,productid....
while saving this, i wnt to code a loop for selected countries and its value member,for each country its value meber is diffrent...from d above replies i can check d items r selected or not..but wat i nedd is each selected countries values.....and similr in products...each products value member..............
..M in WINDOWS appl....help pls..............
Kirtan PatelPosted Nov 18, 2009, 11:49 AM
please check "Do you like this answer check box " if my answer helps you :)
protected void Button1_Click(object sender, EventArgs e)
{
string CheckedString = "";
foreach (ListItem item in CheckBoxList1.Items)
{
if(item.Selected == true)
{
CheckedString += item.Value.ToString();
}
}
Response.Write(CheckedString);
}
Nilanka DharmadasaPosted Nov 18, 2009, 2:23 AM
You need something like below?
Check it and let me know.
If you find my answer helpful, please accept my answer.
SreekanthPosted Nov 17, 2009, 11:59 PM
Kirtan PatelPosted Nov 17, 2009, 11:21 AM
you can do this By Following Way
if my answer helps you then check "Do you like this answer check box" :)
private void button1_Click(object sender, EventArgs e)
{
string CheckedItemsString = "";
foreach (object checkbox in checkedListBox1.CheckedItems)
{
CheckedItemsString += checkbox.ToString();
}
Label1.Text = CheckedItemsString;
}