User810354248 posted
In my asp.net+Vb + Sql web i have a gridview to display data as per date selection.
Date store in DB as this : 2018-11-26 21:06:34.000
Input text box : dtouttxt.text
aspx.vb
Protected Sub dtouttxt_TextChanged(sender As Object, e As EventArgs) Handles dtouttxt.TextChanged
Dim con1 As New SqlConnection(Str)
con1.Open()
Dim qstr2 As String
qstr2 = "Select * from BoxInOut Where DateOut='" + dtouttxt.Text + "'"
Dim sqladp2 As New SqlDataAdapter(qstr2, con1)
Dim dt2 As New DataSet
sqladp2.Fill(dt2, "BoxInOut")
GridView2.DataSource = dt2
GridView2.DataBind()
con1.Close()
End Sub
script for datepicker
<script type="text/javascript">
$(document).ready(function () {
$('#<%= dtouttxt .ClientID%>').datepicker({
dateFormat: 'mm/dd/yy',
changeMonth: true,
changeYear: true
});
});
</script>