User810354248 posted
In my asp.net+VB+SQL web i have a leave request form. In which i have following text boxes to fill details
Leave From, Leave To , Number of days and On duty date
when employee fills Leave from date and leave to date
The number of days gets auto calculated
I want to display on duty date in a text box named.
On duty date will be next day of Leave To
ASPX
<asp:TextBox ID="lvefrom" runat="server"></asp:TextBox>
<asp:TextBox ID="lveto" runat="server" AutoPostBack="True"></asp:TextBox>
<asp:TextBox ID="nodays" runat="server" AutoPostBack="True" Width="35px" style="text-align: center"></asp:TextBox>
<asp:TextBox ID="onduty" runat="server"></asp:TextBox>
VB
Protected Sub lveto_TextChanged(sender As Object, e As EventArgs) Handles lveto.TextChanged
Dim DateTo As DateTime
If Not DateTime.TryParse(lveto.Text, DateTo) Then
'Invalid date to
End If
Dim DateFrom As DateTime
If Not DateTime.TryParse(lvefrom.Text, DateFrom) Then
'Invalid date form
End If
Dim ts As TimeSpan = DateTo - DateFrom
nodays.Text = ts.Days + "1"
End Sub