Hi there,
I get this exception:
System.InvalidCastException was unhandled
Unable to cast object of type 'System.Nullable`1' to type
'System.IConvertible'.
when trying this code:
// A C# 2.0 nullable variable:
DateTime? adate = Convert.ToDateTime("01/01/2005");
FbConnection conn = new FbConnection(connString);
FbCommand cmd = new FbCommand("update facturas set fecha=@fec where
numero=@num", conn);
cmd.Parameters.Add("@fec", FbDbType.Date).Value = adate;
cmd.Parameters.Add("@num", FbDbType.Integer).Value = 20000;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
if the "adate" variable is DateTime instead of DateTime? the code works OK.
Any comments?
Best Regards,
-Benton
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
|