hi frnds,
i had gota problem,
i get the date in mm/dd/yyyy format only...........
when iam accessing date from database in dd/mm/yyyy format itg gets error..
the error is as "Arithmetic overflow error converting expression to data type datetime."
here my code is given below
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1"
Style="z-index: 103; left: 393px; position: absolute; top: 251px">
<RowStyle BackColor="White" ForeColor="#330099" />
<Columns>
<asp:BoundField DataField="date_of_arr" HeaderText="date_of_arr" SortExpression="date_of_arr" />
<asp:BoundField DataField="date_of_dept" HeaderText="date_of_dept" SortExpression="date_of_dept" />
<asp:BoundField DataField="DAYS" HeaderText="DAYS" ReadOnly="True" SortExpression="DAYS" />
</Columns>
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:guest1 %>"
SelectCommand="SELECT date_of_arr, date_of_dept, DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (date_of_arr = @date_of_arr)">
<SelectParameters>
<asp:ControlParameter ControlID="arrivaldate" Name="date_of_arr" PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
here iam using asp.net with vb.net........
database is sqlserver-2005..........