Setting a DateTime as the DefaultValue in SqlDataSource asp:parameter
Sometimes you lose way too much time on the stupidest little things. Maybe this post will save someone else some aggravation.
Using *declarative* syntax, I wanted to create a default datetime value for a SqlDataSource insert parameter. I tried all sorts of date-like values but kept getting errors.
I posted my issue to the microsoft.public.dotnet.framework.aspnet newsgroup and got an answer from Microsoft's Walter Wang to use "2007/12/24":
<insertparameters>
<asp:parameter Name="Title" Type="String"/>
<asp:parameter Name="Description" Type="String" />
<asp:Parameter Name="DateAdded" Type="DateTime" DefaultValue="2007/12/24" />
</insertparameters>
That worked.
I'm still working on how to make the DefaultValue the current date using VB declarative syntax.