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 not sure if it I some doing something wrong, but now after trying my third model I soon give up the "MySql adapter" I have had special problem with Datetime conversion and byte>boolean (generated code)... |
|
|
I think we expect booleans to be represented as BIT(1) in MySQL rather than as byte. DATETIMEs should map to System.DateTimes without any problems though. Can you provide us with a repro case please -- MySQL CREATE TABLE script and C#/VB entity code? Thanks! |
|
|
I have used tinyint(1). All the models have been generated with boolean both through designer and codegen (same codegen templates) The datetime, timestamp, (date/time) I had a lot of problems with... |
|
|
You're finding that tinyint(1) is translated to boolean? In our tests, a tinyint(1) column gets inferred as a (s)byte (which is correct), and is successfully loaded as a byte. Can you provide us with a repro case? Thanks! I still don't have enough information to diagnose your problems with date/time types. Could you be more specific than "a lot"? E.g. designer or runtime? Exception or incorrect type? What's the exception message? What MySQL data type are you using? |
|
|
Hi. I am currently having problems with DATETIME fields in MySQL. The fields contain actual date/time's, not NULLs or zeros. I get "Unable to convert MySQL date/time value to System.DateTime" when i try to query my table. I changed the fields to TIMESTAMP, and got the same error. I downloaded the express edition of Lightspeed yesterday. MySQL Community Edition 5.0.75 Any ideas how to solve this? |
|
|
Both DATETIME and TIMESTAMP columns should convert fine to DateTime properties. This looks like you may have an empty field which is translating into .NET as an out-of-range DateTime: http://bugs.mysql.com/bug.php?id=26054 According to that thread (and to http://forums.mysql.com/read.php?38,134121,175226#msg-175226) setting "Allow Zero Datetime" in the connection string may fix this behaviour. However you do say that your field doesn't contain zeroes so that might not be it. If the above doesn't help, could you post the CREATE TABLE statement and the data for the row that is failing? (If you're not sure which is failing, you can use FindById to test individual rows.) Thanks! |
|