Error by using SQL CE

3 posts, 0 answers
  1. Andreas
    Andreas avatar
    6 posts
    Member since:
    Feb 2011

    Posted 11 Feb 2011 Link to this post

    Im Using Telerik ORM Version 2010.3.1125.1.
    I have a SQL Server 2008 Database. Everything works fine.
    I start the App against a SQL CE 3.5 (with the same structure), and I get the error that a column name is not valid. In the error message the column name is "bt_bsndr_brndschtznforderungen" - this word doesn't exist in the source code. The correct name of the column is "bet_besondereBrandschutzanforderungen", mapped as "BetBesondereBrandschutzanforderungen".
    I get this error with some tables (of course, other columns, but the same behaviour), other parts of the App are working correct.

    Here is the error message (shortened):
    Error executing query: Telerik.OpenAccess.RT.sql.SQLException: Der Spaltenname ist ungültig. [ Node name (if any) = a,Column name = bt_bsndr_brndschtznforderungen ]
       bei Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
       bei OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
       bei OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
    SQL:
    SELECT a.[bet_ID] COL1, a.[bet_aenderung_datum] COL2, a.[bet_aenderung_name] COL3, a.[bt_bsndr_brndschtznforderungen] COL4, a.[bet_Betriebsbezeichnung]
    ....
    Telerik.OpenAccess.RT.sql.SQLException: Der Spaltenname ist ungültig. [ Node name (if any) = a,Column name = bt_bsndr_brndschtznforderungen ]
       bei Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
       bei OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
       bei OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()

    Any ideas? Thanks in advance
    Andreas
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 11 Feb 2011 Link to this post

    Hi Andreas,
    You are using IObjectScope and you have reverse engineered the sql 2005 database, right? If you look into the generated app.config file you will see that some nodes are marke with mssql. This leads to a wrong mapping definition if you try to open the ce database. You can delete those attributes or double them and mark them with sqlce.

    Best wishes,
    Jan Blessenohl
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
  3. DevCraft banner
  4. Andreas
    Andreas avatar
    6 posts
    Member since:
    Feb 2011

    Posted 14 Feb 2011 Link to this post

    Hello Jan,

    Thank you for the answer. I found out the same (five minutes before the weekend...). I tried it with one table, and then it worked. Now I will correct the rest. As far as I see it is a new attribute - the older settings made with older versions of OA dont have the attribute, newer columns / tables (mapped with a newer version of OA) have the attribute. I think I will delete them.

    Regards,
    Andreas

Back to Top