Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default DateTime values in Typed Dataset
Message
From
06/02/2006 17:50:54
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
06/02/2006 13:02:28
Rick Forbes
Brotherhood of Maintenance of Way Employ
Royal Oak, Michigan, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01094021
Message ID:
01094149
Views:
9
>Does anyone know the correct syntax to place a default date value (System.DateTime.Today) in a typed dataset's DefaultValue property??

Unfortunately column default attributes only accept a constant. To get around this you can leave the datetime column out of the schema and let the database handle the default value (and remove it from the DataAdapter's SqlCommands), or you can hook into the DataTable.RowChanged event.

There might be some way to do it in a WinForms application if you are using the DataBindingManager. If this is the case, maybe someone else will post the answer.
Previous
Reply
Map
View

Click here to load this message in the networking platform