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

Reporting Error: Invalid object name 'voa_keygen'

7 Answers 398 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard M
Top achievements
Rank 1
Richard M asked on 04 Jan 2011, 08:41 PM
I created a Telerik Report using the EntityDiagram ORM model to pull information from a Sql Server table.  I added a Telerik Report Viewer to my webpage, Default.aspx, and when I run it I get this error:

Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'voa_keygen'.
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeQuery(String sql)
   at OpenAccessRuntime.Relational.sql.HighLowRelationalKeyGenerator.IsCached(Connection con, RelationalKeyGeneratorInfoCache infoCache, String tab, String kCol, String vCol, String key, Boolean& ret)
   at OpenAccessRuntime.Relational.sql.HighLowRelationalKeyGenerator.init(String className, RelationalTable theClassTable, Connection con, RelationalKeyGeneratorInfoCache relationalKeyGeneratorInfoCache)
   at OpenAccessRuntime.Relational.RelationalStorageManagerFactory.init(Boolean full)

7 Answers, 1 is accepted

Sort by
0
Richard M
Top achievements
Rank 1
answered on 04 Jan 2011, 08:43 PM
I forgot to mention that I am pulling data from a Sql Server view, and not a table.
0
Richard M
Top achievements
Rank 1
answered on 04 Jan 2011, 09:09 PM
I have tried changing the Identity Mechanism to "Backend Calculated" on my EntityDiagram class, and also making sure that a field in my class was set to "Identity".  But I am still getting the error in my EntityDiagrams.cs class:

(error appears in this section of code)
        public IQueryable<V_my_reports> V_my_reports
        {
            get
            {
                return this.GetAll<V_my_reports>();
            }
        }

(error)
Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'voa_keygen'.
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeQuery(String sql)
   at OpenAccessRuntime.Relational.sql.HighLowRelationalKeyGenerator.IsCached(Connection con, RelationalKeyGeneratorInfoCache infoCache, String tab, String kCol, String vCol, String key, Boolean& ret)
   at OpenAccessRuntime.Relational.sql.HighLowRelationalKeyGenerator.init(String className, RelationalTable theClassTable, Connection con, RelationalKeyGeneratorInfoCache relationalKeyGeneratorInfoCache)
   at OpenAccessRuntime.Relational.RelationalStorageManagerFactory.init(Boolean full)
0
Alexander
Telerik team
answered on 05 Jan 2011, 11:43 AM
Hi Richard M,

The 'voa_keygen' table is needed when there is at least one persistent class that uses the HighLow keygenerator.
To avoid the error please make sure none of the classes is using the Default or the HighLow identity mechanisms (the default is actually HighLow). I suspect that in the model you have another class with such settings that is causing the error.
Please let us know if this does not help.

Greetings,
Alexander
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Michael
Top achievements
Rank 1
answered on 07 Nov 2012, 11:53 PM
I'm having the same issue and ALL my references to orm:key-generator in my rlinq file are set with name="autoinc" Is there a global default somewhere I need to change?
0
Alexander
Telerik team
answered on 09 Nov 2012, 04:45 PM
Hello Michael,

Even if you see in the rlinq file that all key-generator nodes are set to autoinc, it is possible that some classes in the model do not have the key-generator option set at all. As the default key generator is HighLow (the one which requires the voa_keygen table), you would get the same error if you have any classes in the model with no identity properties or with identity mechanism set to Default.
For example, if you have classes mapped to views, they would not get automatically any primary keys and you would have to specify them manually. Please have a look at this article for more details how to achieve this.

All the best,
Alexander
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
0
Michael
Top achievements
Rank 1
answered on 09 Nov 2012, 05:28 PM
Wouldn't it make sense to either set a different default or provide an easy way to find these offending entities then rather then sell me on a product intended to make my life easier and save me time then send me on this chase?
0
Ivailo
Telerik team
answered on 14 Nov 2012, 05:29 PM
Hi Michael,

We have evaluated this problem and even the solutions you have suggested, as unfortunately it is indeed recurring frequently.

If we set the default key generator is another one, you wouldn't be able to use the model unless you specify an Identity for your class. With the current generator, you still have errors but only for the classes for which you have specified the table explicitly - the tables that we generate would be fine. So basically we have chosen the better option that would ensure most scenarios would succeed.

You are absolutely right that some kind of an indication should be there for all such cases. For that reason we have added a Validation Warning in the Validation Dialog, which should show you the problematic classes and offer you an automated action for resolving the problem. In case you have found any situation where this warning or error is not presented in the Error Pane, let us know and we will further improve this behavior.

I hope I have shed some light on the matter. Do not hesitate to provide any other feedback you might have.

All the best,
Ivailo
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
Tags
General Discussions
Asked by
Richard M
Top achievements
Rank 1
Answers by
Richard M
Top achievements
Rank 1
Alexander
Telerik team
Michael
Top achievements
Rank 1
Ivailo
Telerik team
Share this question
or