Hi,
My combobox has 4 values as dropdownlist
ALL
Firstname
Lastname
NationalID
Now, if for example, the user selected firstname and entered text on TxtSearch the datagridview is populated accordingly.
However, when the user option to select ALL I want the datagridview to be refreshed, i.e., with all the records displayed.
The below code doesn't do it - please any help!
Thanks
My combobox has 4 values as dropdownlist
ALL
Firstname
Lastname
NationalID
Now, if for example, the user selected firstname and entered text on TxtSearch the datagridview is populated accordingly.
However, when the user option to select ALL I want the datagridview to be refreshed, i.e., with all the records displayed.
The below code doesn't do it - please any help!
Code:
Private Sub cmbSearch_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbSearch.SelectedIndexChanged
Dim cmd As New SqlCommand
Dim conn As SqlConnection = GetDbConnection()
TxtSearch.Clear()
If cmbSearch.SelectedValue = "ALL" Then
Me.TbltenantsTableAdapter.Fill(Me.Dstenantdetails.tbltenants)
PTUpdate.Visible = False
End If
End Sub