Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Put blank date or null into dataset
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00709402
Message ID:
00709419
Vues:
19
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform