Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Put blank date or null into dataset
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00709402
Message ID:
00709419
Views:
18
Evan,

You can also use the following syntax:
dsClinserv.Tables["cresult"].Rows[0]["date_in"] = Convert.DBNull;
>>If a user doesn't fill in a date textbox on my ASP.NET form, I would like to put a blank date or a null into the dataset when the user clicks save. This is my current code
>>
>>
>>dsClinserv.Tables["cresult"].Rows[0]["date_in"] = Convert.ToDateTime(this.txtStart.Text).Date;
>>
>>
>>If tried dsClinserv.Tables["cresult"].Rows[0]["date_in"] = null; but this gives me an error.
>
>Sorry guys, this worked.
>dsClinserv.Tables["cresult"].Rows[0]["date_in"] = Convert.ToDateTime(null);
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform