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
|
Just a wee request:
When I drag a table onto the designer it creates a property for each field. This is good, and I'm happy :-)
It takes each field name and capitalizes it, even if its all in upper case in the database......
So: "id" becomes "Id" and "ID" becomes "Id".
So: when I run queries it complains about missing fields and I'm no longer happy :-(
Being dense it took me FAR too long (don't ask) to work this out, and while the fix is as simple as renaming the Entity properties it would be nice if the designer picked this up and named the fields accordingly :-)
I just kind of assumed that because it generated the Entity from the table directly it would get the names correct.
Other than that, very impressed so far!
|
|
|
Mixed-casing the property names is a deliberate design decision, because that is the CLR convention. You can retain this convention while getting the column names back to the required case by setting the Column Name property in the designer. (Of course, as you've found, changing the property name works as well, but we prefer to keep our properties conventionally capitalised and do database-specific stuff in the Column Name property.) That said, it sounds like we should be automatically filling in the Column Name for you -- we currently don't bother if all we've done is change the case, because most databases don't care, but perhaps we need to detect if the drag is from a case-sensitive database and always populate Column Name if that is the situation. Which database engine are you using? Could you provide us with the CREATE TABLE script for one of the problematic tables? Thanks! |
|
|
</p><p>USE [Dev-...]
Ah, see your point on CLR convention. Switched to using the Column name field (doh). The closest thing we have to a DBA here mentioned Collation, which seems to work at the database level, not the table (don't quote me on that). Once set up its a PITA the change. Cheers,
Matt. |
|
|
Hmm, collation might be the issue -- it looks like you're using SQL Server, which usually doesn't care at all about the casing of column names, but if your database has been set up to be case-sensitive via its collation then that would explain it. If you want to confirm this, you can run the following SQL statement: SELECT CONVERT (varchar, DATABASEPROPERTYEX('xxxxx','collation')) If the result contains _CS_, your database is case-sensitive. If it contains _CI_, your database should not be case-sensitive and something else may be going on! |
|
|
Sorry, yes, SQL Server 2005. And yes, our faux DBA said it was due to collation settings - right click on the Database, properties and check collation : SQL_Latin1_General_CP1_CS_AS The CS bit = case sensitive. |
|