This is a migrated thread and some comments may be shown as answers.

Evaluating as substitute for SubSonic, but immediately get voa_keygen

3 Answers 47 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
AJ
Top achievements
Rank 2
AJ asked on 16 Feb 2012, 04:07 PM
I wanted to start with something I thought would be extremely basic, but I'm already getting some issues. I have searched and read up on a lot of other voa_keygen issues, but I'm not sure why I'm getting it since I'm querying a table and have confirmed that the Identity Mechanism on that table is DatabaseServerCalculated.

Basically, all I wanted to do was create a RadGrid with Auto Generate Columns and have the following for the code behind. 

using(var dbContext = new AMOA.EntitiesModel())
{
         rgUsers.DataSource = (from u in dbContext.Users select u);
}

But I get the "Invalid object name 'voa_keygen'. error. I even went through all my other tables to ensure that the Identity Mechanism was set to DatabaseServerCalculated. The only objects that don't have that are Views. Do I honestly have to go through all those and change them?

3 Answers, 1 is accepted

Sort by
0
AJ
Top achievements
Rank 2
answered on 16 Feb 2012, 04:52 PM
I did run the following query to create the voa_keygen table in the database; however, when I try to run "Update from Database" it doesn't show up in the list of tables. Using the exact same connection string, Subsonic picked up on the new table right away.

CREATE TABLE [voa_keygen] (
   [TABLE_NAME] varchar(64) NOT NULL,
   [last_used_id] INT NOT NULL,
   CONSTRAINT [pk_voa_keygen] PRIMARY KEY ([TABLE_NAME])
)
GO

I'm completely lost now... 
0
AJ
Top achievements
Rank 2
answered on 20 Feb 2012, 03:51 PM
Any advice?
0
Alexander
Telerik team
answered on 20 Feb 2012, 05:37 PM
Hi AJ,

I am afraid that the correct way to solve this problem is by selecting primary key properties for the classes mapped to views. Otherwise read operations on these views will not work properly and the presence of the voa_keygen table would not help. For more details you could have a look at this article - How to: Work with Views and Classes Without Primary Key.

Please note that the voa_keygen table is used internally (it is not needed in the model) and that is why it is filtered and not displayed in the OpenAccess wizards.

Kind regards,
Alexander
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Getting Started
Asked by
AJ
Top achievements
Rank 2
Answers by
AJ
Top achievements
Rank 2
Alexander
Telerik team
Share this question
or