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! Is this possible to create entity in LightSpeed if table has no primary key? Tables which I'm accessing can't be changed and I want only read data from this database. Thanks |
|
|
LightSpeed requires that there be a column whose values can be used as identifiers (i.e. values are unique). This column must be called Id (or TableAttribute must be used to map the IdentityColumnName). I don't think it's necessary that the column actually be a primary key, but we haven't tested this scenario. (The designer *does* depend on the primary key, but I think it will create the entity for you anyway, just complain and remind you to fix it up by hand! Or you can create the entity manually using the toolbox.) So if your tables have unique columns then you should be okay, but we would strongly advise doing a quick test before going too far down the road with LightSpeed. If there is no single column which can be used as a unique identifier for each row, then I'm afraid you are probably out of luck. |
|
|
This time I'm probably out of luck because I'm facing another issue where table has two primary keys. So I think I'll use for this Linq to SQL. Thanks for help.
|
|
|
Hi, has this since been verified? I have a read-only Oracle table without any primary keys that would be very difficult to change. I need to know if Mindscape would require a primary key to create an entity. Thanks! |
|
|
We require a unique identifier (which can be a composite of more than one column if required -- see the section on composite keys in the 'Legacy Databases' chapter of the user guide). It does not have to be marked as a PK in the database, but we do need to have something that we can use as a unique key, and that something has to be mapped to our Id property (using Identity Column Name). |
|