Hi Joe, Just curious. Do you know how the Visual Studio Designer works? In designer, the Null value is converted to 0. I would like to something similar.
Thanks -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Joe Mistachkin Sent: Thursday, January 03, 2013 11:23 AM To: 'General Discussion of SQLite Database' Subject: Re: [sqlite] Mapping Sqlite INTEGER field to C# Nullable<long> Quanren Xiong wrote: > > I mapped a Sqlite INTEGER field to a C# Nullable<long> property in EF 5.0. > > When the field is NULL, Visual Studio throws exception with following info: > The method throwing the exception (System.Data.SQLite.SQLiteDataReader.GetInt64) does not attempt to automatically convert NULL to zero. Instead, it throws an exception, which seems to be the correct behavior, given the IDataRecord interface semantics (i.e. otherwise, the caller would have no way to know that the value is NULL). For fields that could be NULL, the GetValue method should be used instead. Alternatively, the IsDBNull method may be called to check if the underlying column value is NULL prior to calling one of the strongly typed methods. However, I'm not sure how to get the Entity Framework to do that. -- Joe Mistachkin _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

