insert the selected values from the checkboxlist into database
-
How do i insert the selected values from the checkboxlist into database and then retrieve them....here i am selecting the multiple items from the checkboxlist i can get the selected values but i cant insert them get insert string not in right format -- im passing 1,4,7 to the variable also how do i retrieve and get the selected values?
-
How do i insert the selected values from the checkboxlist into database and then retrieve them....here i am selecting the multiple items from the checkboxlist i can get the selected values but i cant insert them get insert string not in right format -- im passing 1,4,7 to the variable also how do i retrieve and get the selected values?
i think u want store text of selected value
Piyush Vardhan Singh
-
i think u want store text of selected value
Piyush Vardhan Singh
selected ids, not text.....
-
How do i insert the selected values from the checkboxlist into database and then retrieve them....here i am selecting the multiple items from the checkboxlist i can get the selected values but i cant insert them get insert string not in right format -- im passing 1,4,7 to the variable also how do i retrieve and get the selected values?
Try this code.If it doesn't helps you send me your code. Dim str as string For i = 0 To checkboxlist1.Items.Count - 1 If checkboxlist1.Items(i).Selected = True Then str = checkboxlist1.Items(i).Value & "," & str End If Next Then,take the substring of str and pass it to the database. God is always with you.
-
selected ids, not text.....
string str1 = CheckBoxList1.SelectedValue;
Piyush Vardhan Singh
-
Try this code.If it doesn't helps you send me your code. Dim str as string For i = 0 To checkboxlist1.Items.Count - 1 If checkboxlist1.Items(i).Selected = True Then str = checkboxlist1.Items(i).Value & "," & str End If Next Then,take the substring of str and pass it to the database. God is always with you.
ya...this is working fine....but how can i retrieve those(text..not ids now) and place those in Datgarid
-
ya...this is working fine....but how can i retrieve those(text..not ids now) and place those in Datgarid
You have to get the total number of rows from the table.Use Dataset. For example, For i = 0 To sqlDataset.Tables(0).Rows.Count - 1 //Your Code. Next Then get the checkbox items that are checked. God is always with you.