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 have a view in the DB with a column that says: SELECT TableA.*, count(*) - count(TableB.colA) as colX FROM TableA left join TableB on TableA.Id = TableB.TableAId GROUP by TableA.Id I have an LS object that inherits from TableA and defines the extra column as: public class ViewX : TableA { private int _colX; public int colX{ get{return Get(ref _colX);} } }
I get an exception when trying to get a list of these objects. If I use int? as the objects field and property type the value is always NULL. Is this a bug? or am i doign something wrong?
PS For the sake of brevity this is a simplified view of what im doing. |
|
|
PS PS Im using MySQL provider |
|
|
I have a (very) vague feeling that MySQL COUNTs are returned as long. Could you try changing the type of _colX and colX to long (and/or long?) and see if that helps? Thanks! |
|
|
lol - got it - i had to use the long type instead of int. go figure. |
|
|
lol X 2 - you beat me to it |
|
|
"go figure." Yeah... the type conversion rules in LightSpeed 2.1 are a bit unforgiving I'm afraid! We're changing this in 2.2 so that things like long/int or double/float mismatches should no longer result in an InvalidCastException (unless of course the database really does return a value too big to fit into the declared type!). |
|