How to disable and uncheck the checkbox values from database fields..VB.NET

后端 未结 1 1962
不知归路
不知归路 2020-12-12 07:48

I have retrieved checkbox checked values & put in textbox as 1,2,3,4,5...so on ...and inserted into database ... using vb.net

Have a look at my database

相关标签:
1条回答
  • 2020-12-12 08:16
    Dim checked = From chosen in db.Table Where chosen.date = "11/10/2010" Select chosen.checked
    
    Dim boxes as new List (of string)
    For each item in checked
       boxes.addrange(item.split(","c))
    Next
    
    Dim BoxNums = From boxnum in boxes Distinct Select "checkbox" + Cstr(boxnum)
    
    For Each but As CheckBox In YourForm.Controls
       For Each boxname As String In boxnums
            If but.Name = boxname Then
                but.Checked = False
                but.Enabled = False
            End If
        Next
    Next
    
    0 讨论(0)
提交回复
热议问题