New Posts New Posts RSS Feed: SQL Server Compact Edition
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

SQL Server Compact Edition

 Post Reply Post Reply
Author
rajmuthusamy View Drop Down
Newbie
Newbie


Joined: 28-Apr-2010
Location: Fresno, CA
Posts: 3
Post Options Post Options   Quote rajmuthusamy Quote  Post ReplyReply Direct Link To This Post Topic: SQL Server Compact Edition
    Posted: 28-Apr-2010 at 8:41am

I'm trying to make our application connect to SQL Server Compact Edition and not sucessful so far. Anyone has tried before with DevForce Classic? If you have any examples with Connectionstring, please send that to me.

 
Thanks,
Raj
Back to Top
JoshO View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Location: United States
Posts: 86
Post Options Post Options   Quote JoshO Quote  Post ReplyReply Direct Link To This Post Posted: 28-Apr-2010 at 1:04pm
uploads/3/Chapter_4_Appendix_-_Connecting_to_SQL_Server_Compact_Edition.zip
 
In the Developers Guide installed with DevForce, you will find complete information regarding SQL Server CE in Chapter 4 : Appendix.
I have included the relevant portion in the attached Word document above. There are also some links with information regarding issues with SQL CE from previous support questions:

DevForce will support any provider supported by the Entity Framework.  I did google a bit to see if there are known issues with SQL CE and EF, and found a few things relating to the machine.config or app.config, which I’ve linked below.  The first link also indicates that SQL CE SP1 is required.

http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/aa5850bb-34fe-4064-82b0-4a7cac675c91/

http://www.cybersprocket.com/wiki/index.php/SQL_CE

http://www.codeproject.com/KB/database/SQLCompactGotchas.aspx

Back to Top
rajmuthusamy View Drop Down
Newbie
Newbie


Joined: 28-Apr-2010
Location: Fresno, CA
Posts: 3
Post Options Post Options   Quote rajmuthusamy Quote  Post ReplyReply Direct Link To This Post Posted: 28-Apr-2010 at 2:14pm
Yes, the section provides an example. However, it doesn't work when I tried.
 
I just copied the same connection string given in the Developers guid and pasted into the Object Mapper and it said "Unable to connect".
Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=[mypath\myfile].sdf;Persist Security Info=False
 
When I tried to register "Microsoft SQL Server CE 3.0 OLE DB Provider for Windows" as per the instruction given in the guide, I couldn't find the key that that needs to be edited. This is the key that I need to edit as per the guide.
"[HKEY_CLASSES_ROOT\CLSID\{32CE2952-2585-49a6-AEFF-1732076C2945} "
 
I couldn't make the Object Mapper both manually as well as through Data Link connect to the CE database.
 
Back to Top
JoshO View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Location: United States
Posts: 86
Post Options Post Options   Quote JoshO Quote  Post ReplyReply Direct Link To This Post Posted: 28-Apr-2010 at 3:33pm
If you don't have the CLSID key, then you don't have SQL CE version 3.0.
You may have version 3.5 which has a corrosponding key of:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F49C559D-E9E5-467C-8C18-3326AAE4EBCC}
 
You need to find out which version of SQL CE you have and then find the key for that version. Then you use the same instructions for adding the "OLE DB Provider" key which would look like this for CE version 3.5:
 
 
 
and the new default string value for the key:
 
 
Back to Top
JoshO View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Location: United States
Posts: 86
Post Options Post Options   Quote JoshO Quote  Post ReplyReply Direct Link To This Post Posted: 28-Apr-2010 at 3:37pm
Of course, the "Provider" info in your connection string is version specific which is also why your connection is failing: you don't have CE version 3.0 - I am guessing you have a good path to a valid .sdf file as well:
 
Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=[mypath\myfile].sdf;Persist Security Info=False
 
 
Back to Top
rajmuthusamy View Drop Down
Newbie
Newbie


Joined: 28-Apr-2010
Location: Fresno, CA
Posts: 3
Post Options Post Options   Quote rajmuthusamy Quote  Post ReplyReply Direct Link To This Post Posted: 28-Apr-2010 at 4:48pm
 I have SQL CE 3.0. I just opened up my 2005 Management Studio and connected to CE 3.0. You can see the status bar of the stuido below. The version towards the right shows the 3.0
  
 
 
 
Not sure why that particular key is not there.
 
Anyway, I have CE 3.5 as well. I will try the other key that you provided and see if that works.
 
Thanks,
Raj
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down