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

OA / VS2010 / SQL CE 4.0 Error?

2 Answers 23 Views
Integration with other products
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian Azzi
Top achievements
Rank 2
Brian Azzi asked on 14 Feb 2013, 08:30 PM
Hey guys... I'm really new to OA & am trying to get a feel for using it in a simple situation with a small web app & a local SQL CE 4.0 database.

I've set up a basic model in my project, and have loaded it from the DB (which has one simple table). This all looks fine, and I can then proceed and add an OpenAccess LINQ DataSource. 

Great, looks like I'm setup. : )   Now here is my problem:

If I go to the EntityModel (I just called it that by default), in the OA Model Explorer I can right click on the model and choose to "Update from Database...". When I do this, the OA dialog comes up but contains the following error every time (in the Choose Schemas dialog):

"Unable to retrieve the database schema information. Reason: Could not load type 'System.Data.SqlServerCe.SqlCeException' from assembly 'Microsoft.SqlServerCe.Client, Version=3.5.0.0, Culture=neutral...." etc. etc.

This appears to indicate that it's trying to use the 3.5 assemblies rather than 4.0? (I didn't install SQL CE 3.5 at all)...

So.. to update my schema, I've had to recreate the entire EntitiyModel each time (not very ideal).

Any ideas?

Thanks!
-Brian

(p.s.-> Let me know if this would be better served as a direct ticket but I wanted to post it to the community for any new people like me that may run into this issue).

2 Answers, 1 is accepted

Sort by
0
Brian Azzi
Top achievements
Rank 2
answered on 14 Feb 2013, 08:33 PM
Very Quick Update:

Of course as soon as I post... I found that i just needed to change my web.config to point to 4.0 instead of 3.5:

providerName="Microsoft.SqlServerCe.Client.4.0"

I'm still not entirely sure why OA created the connection string as 3.5 based... but this seemed to fix my problem.

: )


EDIT:

Hmm... no matter what I do, when I use the Telerik menu to create the EntityModel, it always adds Telerik.OpenAccess.35.Extensions (not 4.0)... is this correct? (Along with Telerik.OpenAcess.Web.40). If I manually add the 4.0 extensions assembly, then I get compile errors.

Also the OA designer wizards always seem to do their best to revert my connection string back to using SQL CE 3.5, NOT 4.0... which is where I get all these exceptions being generated.
0
PetarP
Telerik team
answered on 20 Feb 2013, 09:20 AM
Hi Brian,
even if the CE4.0 sounds like it is a .NET 4.0 only assembly, that is not true. You can use it in 3.5 or 4.0 applications. Only the EF part (what we do not use) is .NET 4.0 only.

The OpenAccess 3.5 extensions assembly contains mainly our Linq implementation, it has to be used in 3.5 and 4.0 application. In our current release the 4.0 assembly contains only our Data service v1 implementation and my best guess is that you don't need it referenced.

All the best,
Petar
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Tags
Integration with other products
Asked by
Brian Azzi
Top achievements
Rank 2
Answers by
Brian Azzi
Top achievements
Rank 2
PetarP
Telerik team
Share this question
or