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
|
Hello, Using MySQL 5.6 and Lightspeed assembly 5.0.2684.0, this happens with my code (obtained from the Lightspeed Logger):
The column in MySQL is of type Decimal(10,3).. I'm not changing the value of 'Docvalue' in my code.. I read the object from database using my UOW and change some other values of the object and do a .SaveChanges() on the UOW. I get an Exception in my code 'invalid mysql query' because of the comma in the decimal value. How can I change this, so Lightspeed does not put the comma in the decimal value, but leaves the '.' ? Is it some localization setting? Searched the forums, but did not find something. Thanks in advance, lckuiper |
|
|
Also tried latest nightly build of 9 feb 2014 - 5.0.2697.0, same problem. |
|
|
Are you sure the error is due to the formatting of the number? The output emitted by the Logger is generally not the actual SQL which is sent to the server as we pass any values via parameters. e.g. --> ?p8 Input Decimal 2660.700 We are sending 2660.7 as a decimal parameter, so its then down to the underlying ADO.NET provider to communicate that to the server which it will as a input parameter to the query. I wouldn't expect any string translation to be involved in doing this though and the parameter should be being passed directly as a decimal. Are you able to elaborate on the specific error message you are seeing?
|
|
|
I did some other tests, like changing the decimal column in the database to a double. I did not change the value of property 'docvalue' in the object. The type of the property 'docvalue' is the same as the database column, i.e. decimal or double. I use MySQL connector 6.8.3, Visual Studio 2013 Professional, .NET framework 4.5.1. This is the error message I get:
|
|
|
Hmm doesn't help much in determining what the invalid syntax is. If its possible to send through a quick repro project (presumably just that entity off the model and some code to insert and then perform the update to trip this) then I can have a look into whats going on here and see if there is a bug we can fix. In terms of why DocValue is included in the update statement even though it has not changed, all properties are included in the update because we update the whole entity state not just the fields that have changed. If you do want to restrict the update to just the fields which have changed you can do this in 2 ways, either by opting in to Optimistic Concurrency by adding a LockVersion field to your entity or by using the [UnversionedPartialUpdate] attribute on your entity (see http://www.mindscapehq.com/forums/thread/4551 for some context around this).
|
|
|
Sorted it out.. it actually had nothing to do with decimal separators :| I thought so, because of the logger output. I introduced a new column called 'interval' in my table, which is a reserved keyword in MySQL. By removing all columns and adding them one by one in my lsmodel, I found the column which introduced the query error. Thanks for your prompt replies. Luuk |
|