Hi i have an application with some controls and a checked listbox filled with "products". What I need is how can I add the selected "products" in my db using VB.NET...
Thanks in advance for helping me
Hi i have an application with some controls and a checked listbox filled with "products". What I need is how can I add the selected "products" in my db using VB.NET...
Thanks in advance for helping me
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Blocked AccountRank #403 · 6.2K reputationPosted Mar 9, 2008, 8:58 PM EDT
Hi Friend, By using this code you can take the selected value in a sigle variable. Now storing in the database depend on the database structure u are using. Dim strselecteditems As String= ""If ListBox1.Items(i).Selected Then
strselecteditems = strselecteditems + ListBox1.Items(i).Text
End If
Next
Happy Coding!!
Alex papaioannou10 reputationPosted Mar 11, 2008, 10:03 AM EDT
Bhim Kunwar6 reputationPosted Aug 31, 2008, 3:11 AM EDT
i hope this code may help u to a great extent
Dim
Sno As New StringBuilder Dim drow As DataRowView Dim ListOfsno As New ArrayList For Each drow In chkLBVoucher.CheckedItemsSno.Append(drow(0))
Sno.Append(
",")ListOfsno.Add(drow(0))
Next If Sno.Length > 0 ThenSno.Remove(Sno.Length - 1, 1)
End Ifbest regards