Invalid object name 'voa_keygen'

5 posts, 0 answers
  1. Eric Krauska
    Eric Krauska avatar
    26 posts
    Member since:
    Dec 2007

    Posted 19 Jan 2011 Link to this post

    Brand new project using EntityDiagram.  All tables were pulled from the DB and the primary key for each table is a guid.  Upon the first call to our DataContext, we get the below error.  All the posts on the forum I've found relating to this error are for the "Classic" version of OpenAccess, so I have been unable to figure out what is going on here.  Any help is appreciated.

    Code that raises the exception:
    using (DAL.BarcodeDataContext dal = new DAL.BarcodeDataContext())
    {
        DAL.User user = (from n in dal.Users where n.LoginID == username && n.Password == password select n).Single();
        if (user != null) return true;
        else return false;
    }

    Exception raised:
    Invalid object name 'voa_keygen'. Telerik.OpenAccess.RT.sql.SQLException: 
    Invalid object name 'voa_keygen'.<BR>   at 
    Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeQuery(String sql)
  2. Eric Krauska
    Eric Krauska avatar
    26 posts
    Member since:
    Dec 2007

    Posted 19 Jan 2011 Link to this post

    Sorry, I just figured this out.  The exception is not a friendly one at all.  It ends up the error was caused by a View that was mapped to a persistent type and the view did not have a primary key specified.  I removed the mapping the view and all is well.  
  3. DevCraft banner
  4. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 20 Jan 2011 Link to this post

    Hello Eric Krauska,

    This table is required by OpenAccess when one or more classes in the model use internal identity. Internal identity means that the persistent class does not have an identity member defined and this should be handled automatically. The implementation of this mechanism uses the HighLow keygenerator and that is why OpenAccess needs the "voa_keygen" table to store some system values.
    By default classes mapped to database views are not generated with identity members and OpenAccess treats them as classes with internal identity. If all classes in your model have identity members and their IdentityMechanism property is not set to Default or HighLow, you should not observe this error.
    Hope that helps.

    All the best,
    Alexander
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
  5. Ken
    Ken avatar
    1 posts
    Member since:
    Mar 2009

    Posted 22 Sep 2011 Link to this post

    Hello, regarding the last sentence in your response (If all classes in your model have identity members and their IdentityMechanism property is not set to Default or HighLow, you should not observe this error.) I assume this means all non sql view classes which don't require the identity mechanism. I have my PK columns set up as guid and the key generator set to

    [

     

    KeyGenerator(KeyGenerator.Guid)].

     

    Why do I still get this error?

    Thanks Ken
  6. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 27 Sep 2011 Link to this post

    Hello Ken,

    I just verified that having only classes with Guid identity should not require the voa_keygen table to be present in the database. It would be best if you could send us your rlinq file in a support ticket, so we can have a look at the model and find the reason why this table is needed in your case. 

    Kind regards,
    Alexander
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

Back to Top
DevCraft banner