How to plug system date/time value in Insert parameters?
Posted on 2006-07-16
Hello - I've got a data entry page where I need to maintain input & update date-time stamps
I'm trying to set these in the parameters
<asp:Parameter Name="MyField1" Type="Int32" />
<asp:Parameter Name="MyField2" Type="String" />
<asp:Parameter Name="MyField3" Type="String" />
<asp:Parameter Name="InputOn" Type="DateTime" />
<asp:Parameter Name="InputBy" Type="String" />
<asp:Parameter Name="InputOn" Type="DateTime" DefaultValue=Now() />
but that gets:
Exception occurred: The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.
(I know one way to get around this would be to set the Default value field back in the SQL Server table, but I need to set an accompanying "UpdateOn" field if/when the record is updated, so I might as well be consistent.)
And if it's not too much trouble, can anybody point me to a more advanced reference on how to set parameter values from sources other than form fields? Like Session variables, Profile values, etc...?