This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm using the nightly build from 1/10/09. I have a bit field in MSSQL 2005 that is nullable. The import declaration to the Lightspeed model is correct (System.Nullable<bool> Active). However, it appears that the Active property is always evaluated as null, despite the fact that the data in the table has no null values. Has anyone else seen this before? Just a simple bug, or something deeper at work here? Thanks. Dan |
|
|
Not sure what's going on there -- I've done a quick test here and we are able to load from a nullable bit field into a Nullable<bool> successfully -- and I don't think there are any changes since 10 Jan that would be disguising a bug. Could you post your SQL CREATE TABLE script, your LightSpeed class and some sample data? Thanks! |
|
|
Ok, I figured it out. Mostly my fault, but maybe just a *bit* more that LightSpeed could do here. :) I generated the LightsSpeed model from one database where the structure was like this, and it generated Nullable<bool> for Active. So far, all is right in the world. CREATE TABLE Foo ( However, I changed my connection string to point to another database that had not yet changed the datatype for Active. It was still set as tinyint on that database. When I ran, the Active property is always null. Obviously, updating the table to use a bit field made the problem go away. However, I would think that the behavior from LightSpeed should be different. It should (preferably) consume the database field as the type the LS model is expecting. If it can't convert, then at least it should warn/error out. Dan |
|
|
Agreed, this should signal an error. I've logged a bug for this. Thanks for letting us know about it! |
|