Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
Dim qry = From p In db.Resume2s Join c In db.Day_date2s On p.ID Equals c.ID _
Select C1 = c.ID_Date, P1 = p.ID, P2 = p.Title, P3 = p.Name, P4 = p.LastName, _
C2 = c.Name, C3 = c.Day_date, C4 = c.Time
Select Case cboSearch.SelectedIndex
Case 0
qry = (From c In db.Day_date2s) _
.Where(Function(s) s.ID_Date.StartsWith(txtSearch.Text))
Case 1
qry = (From c In db.Day_date2s) _
.Where(Function(s) s.ID.StartsWith(txtSearch.Text))
Case 2
qry = (From p In db.Resume2s) _
.Where(Function(s) s.Name.StartsWith(txtSearch.Text))
Case 3
qry = (From c In db.Day_date2s) _
.Where(Function(s) s.Name.StartsWith(cboDoctor.SelectedValue))
Case 4
qry = (From c In db.Day_date2s) _
.Where(Function(s) s.Time.StartsWith(cboTime.SelectedValue))
End Select
dgvDateTime.DataSource = qry
End Sub