Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign DBNull.Value to datatime data column
Message
From
24/07/2008 00:12:29
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Assign DBNull.Value to datatime data column
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01333634
Message ID:
01333634
Views:
57
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.
Next
Reply
Map
View

Click here to load this message in the networking platform