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
|
Hi, I run this code: using (var uow = _context.CreateUnitOfWork())
// "Invalid object name 'KeyTable'." //so I ran the KeyTable.sql file
To workaround the issue I've SET IDENTITY_INSERT OFF I see why this is necessary with Oracle tables to get around sequences, but with SQL server I've been looking at SQL profiler but cant work out how you can omit the Id field being inserted? I've checked the properties for entities in LightSpeed Model. I've tried setting the entities Identity Column Name (as per http://www.mindscape.co.nz/forums/Thread.aspx?PostID=3291) and etc, but no luck. This posts (http://www.mindscape.co.nz/forums/Thread.aspx?PostID=7290) suggestion of setting transient is no good I as want to persist the data. Hope this makes sense, its getting late.
|
|
|
You are getting the error because you have indicated to LightSpeed that it should use the KeyTable based identity strategy (which is also the default), but your tables are actually using an Identity Column approach. You can correct this by setting your IdentityMethod to IdentityColumn. e.g. in configuration you would specify: identityMethod="IdentityColumn" in your associated LightSpeedContext declaration.
Jeremy |
|
|
Great this works perfectly. Thanks Jeremy. As I'm evaluating LightSpeed I am listing Q's and wishlist items as they arise in a file that I will eventually post. One thing at present that I'm sure you'll agree with is support for intellisense in config files. Initially I did check what options were available, but no intellisense... Below is a picture of ConnectionString vs LightSpeedContexts config options and all the ms settings like ConnectionString support Intellisense, I"m guessing I'm probably just missing an extra file I need to load, like a VSDoc file. |
|