Asp.net date binding error with zeros
I have a null date in my database. I am connecting to it using LinqDataSource and bind to FormView. It allows you to put dates in order, but if you remove the date, I need to insert a null value into the db. Instead, you are throwing an exception.
<asp:TextBox ID="TxtStartDate" runat="server"
Text='<%# Bind("StartDate", "{0:MM/dd/yyyy}") %>' />
Works great if you put a date in it, but if you remove the date and keep it, you get System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. How do I make it send null?
+1
source to share