Hello,
I am using a ASP Calendar control to insert a datetime value into a field to be part of an insert to a SQL Server 2005 db table.
I get the following error when i submit the form to server and try to insert into table:
[ArgumentException: The version of SQL Server in use does not support datatype 'date'.]
Seems like Calendar control returns a Date type value. How could i make the Calendar control return a Datetime value instead?
I know now that SQL Server 2005 does not support Date type fields.
Here is my client code where I have my Calendar control in a FormView:
<tr>
<td class="style4">
Date</td>
<td>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White"
BorderColor="#3366CC" BorderWidth="1px" CellPadding="1"
DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="#003399" Height="200px" SelectedDate='<%# Bind("EventDate") %>'
Width="220px">
<SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
<WeekendDayStyle BackColor="#CCCCFF" />
<TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#999999" />
<NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" />
<DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" />
<TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px"
Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" />
</asp:Calendar>
</td>
</tr>