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

Error by using SQL CE

2 Answers 61 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andreas
Top achievements
Rank 1
Andreas asked on 11 Feb 2011, 02:42 PM
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 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 11 Feb 2011, 05:59 PM
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.
0
Andreas
Top achievements
Rank 1
answered on 14 Feb 2011, 09:39 AM
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

Tags
Databases and Data Types
Asked by
Andreas
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or