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, In my database, i have a one-to-one relationship between two tables: Company and UserCompany. Company has an PK identity column (SqlServer2008) named Id, UserCompany has a PK column named Id (non-identity) on which the relationship is. Dragging the tables to the designer, I was given a one-to-many relationship, which I converted to a one-to-one using the designer's "Convert to One-to-One Association". Trying to query UserCompany.Company throws this exception: System.Data.SqlClient.SqlException : Invalid column name 'CompanyId'. Which doesn't exist in my database, since the one-to-one relationship is done via the Id field. How can I tell LS to use the Id field for the one-to-one relation?
Best regards, -Jonathan |
|
|
Select the association arrow, go to the Properties window, and change the Column Name to be the name of the foreign key column. Note, however, that LightSpeed does not support using the Id (primary key) as a foreign key. If this is your scenario, then for a workaround, see http://www.mindscape.co.nz/forums/Post.aspx?ThreadID=2447&PostID=7155. |
|