Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assign DBNull.Value to datatime data column
Message
De
24/07/2008 00:12:29
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Assign DBNull.Value to datatime data column
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MySQL
Divers
Thread ID:
01333634
Message ID:
01333634
Vues:
58
Hi,

I have error message :Object cannot be cast from DBNull to other types. when i try to assign null value to poDate data field. My database is mySql.
  protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
  {
        if (e.NewValues["poDate"] == null)
           e.NewValues["poDate"] = DBNull.Value ;
How to solve this problem?

TIA.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform