I have many columns in database table in which one is of bool type (1/0) and number of user records associated with manager id like mid 1 has 20 users rows and mid 2 has associated to 35 rows.
In the UI, having one checkbox. When you deselect the check box, it should check at least one user is having this checkbox as checked (true - 1 in database). If not, throw an error message stating that at least one user associated with this mid should be checked with this checkbox field.
=============
Can i try like this
In the method i will write select count(*) from tblEmp where mid = @valueparameter
In the code behind, assigning dataset to variable and if variable.count >= 1 then allow to submit or other operation
else throw warning message (not allow submit).
What I have tried:
Method to get users:
Public Function GetUsersInfo() As System.Data.DataSet
Dim sql As String = "SELECT * from tblEmp where mid = @PO"
Dim theDBH_v2 As New DBHelper_v2
Return (theDBH_v2.ExecuteGetDataSetSQL(sql))
End Function
Code:
If CheckContractApprover.Checked = False Then
'Here fetching the data using above method is fine, how to check at least one user is checked in this field.
End If