Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim _date As Date = ASPDateEdit1.Date
Dim date1 As String = _date.Day.ToString("00") & "/" & _date.Month.ToString("00") & "/" & _date.Year.ToString("0000")
Dim Conn As New SqlConnection(webConnect)
Dim sql As String = " SELECT tblProgram.ProgramName,tblServiceRequest.Username,tblServiceRequest.Requests, tblServiceRequests.RequestsName, tblServiceRequests.DateRequests, tblServiceRequests.Time_Requests, tblServiceRequests.RequestsID, tblServiceRequests.StatusPic FROM tblServiceRequests INNER JOIN tblProgram ON tblServiceRequests.ProgramID = tblProgram.ProgramID WHERE tblServiceRequests.DateRequests '" & date_.ToString & "' ORDER BY DateRequests DESC "
Dim cmd As New SqlCommand(sql, Conn)
cmd.CommandType = CommandType.Text
cmd.Connection = Conn
Conn.Open()
dr = cmd.ExecuteReader()
Try
aspgirdview.DataSourceID = ""
aspgirdview.DataSource = SqlDataSource1
aspgirdview.DataBind()
Catch ex As Exception
MsgBox(ex.Message)
Finally
Conn.Close()
Conn.Dispose()
dr.Close()
dr = Nothing
End Try
End Sub