Dear Sir,
how to filter data using checkboxes vb.net
i have checkboxes which is Male and Female
for example i check the Male then it will filter all the male when i uncheck the male checkboxes it load all my data
if tick check the Female then it will filter all the Female when i uncheck the Female checkboxes it load all my data and when i tick them both it will show all Male and Female in my datagrid
If chkmale.Checked = True Then
dcom.Connection = ultracon
da = New MySqlDataAdapter("Select * from tblenrolledstudents WHERE stud_gender IN ('M')", ultracon)
da.Fill(dset, "tblenrolledstudents")
dgvExportData.DataSource = dset.Tables("tblenrolledstudents").DefaultView
lblCounter.Text = dset.Tables("tblenrolledstudents").Rows.Count & " " & "Record(s) Found"
ElseIf chkmale.Checked = False Then
pop_ExportData()
End If
If chkfemale.Checked = True Then
dcom.Connection = ultracon
da = New MySqlDataAdapter("Select * from tblenrolledstudents WHERE stud_gender IN ('F')", ultracon)
da.Fill(dset, "tblenrolledstudents")
dgvExportData.DataSource = dset.Tables("tblenrolledstudents").DefaultView
lblCounter.Text = dset.Tables("tblenrolledstudents").Rows.Count & " " & "Record(s) Found"
End If
Thank you for your help appreciate it