Another Simple Question

Posts   
 
    
SamRose
User
Posts: 20
Joined: 24-Jun-2008
# Posted on: 04-Dec-2008 17:41:42   

Where do I put the ConnectionString for my mobile application when using SQL CE?

I placed it in here in the app.config file, but it doesn't pick it up. <appSettings> <add key="Main.ConnectionString" value="data source=\Program Files\Handheld\HandheldDB.sdf;"/> </appSettings>

Using .net cf 3.5 and sql 3.5 and llblgen 2.6

Thank you

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Dec-2008 07:09:46   

Hi Sam...

Please follow these instructions.

Another threads about that: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=14608 http://llblgen.com/TinyForum/Messages.aspx?ThreadID=14316

If you are still stuck, please post more info (exception details, RTL, etc.).

David Elizondo | LLBLGen Support Team
SamRose
User
Posts: 20
Joined: 24-Jun-2008
# Posted on: 05-Dec-2008 13:46:16   

Hi daelmo,

Thanks for your help so far.

I've not been able to use the app.config as it's a CF3.5 framework so I have set it manually with a config file of my own.

What I am struggling on is how to accomplish the following...

my .NET 3.5CF application access the SQL CE 3.5 very nicely. But when I try to use the same application and passing in the SQL Connection string to point to a full SQL Server it fails with the following error message.

Unknown connection option in connection string: initial catalog.

Now investigating this it looks like I should be changing the DataAccessAdapter.SetSqlServerCompatibilityLevel() but I can't seem to do that in the code as its not a method of the DataAccessAdapter using the SD.LLBLGEN.Pro.ORMSupportClasses.CF35.

So in a nutshell, I'm trying to connect to 2 databases with the same structure, one in SQL CE the other in SQL Server, through the CF3.5 application

Thanks Sam

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 06-Dec-2008 11:32:23   

The CF.NET version can't connect to a sqlserver instance over the wire, it's for compact framework only. Are you connecting to a sqlserver instance over the network from your cf.net application?

Frans Bouma | Lead developer LLBLGen Pro
SamRose
User
Posts: 20
Joined: 24-Jun-2008
# Posted on: 06-Dec-2008 14:16:37   

Hi Otis,

Yes basically, what I'm trying to do is connect to SQL Server 2005 from my CF.Net application across the network.

Is this possible?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 06-Dec-2008 14:35:07   

SamRose wrote:

Hi Otis,

Yes basically, what I'm trying to do is connect to SQL Server 2005 from my CF.Net application across the network.

Is this possible?

No that's not possible, because that would require the DQE to be compiled with another provider as well (and that's a bit of a pain). So that's not supported.

Frans Bouma | Lead developer LLBLGen Pro