index > SQL Server Everywhere Edition > Connection string for SqlCeConnection

Connection string for SqlCeConnection

Which format is assumed for connection string for SqlCeConnection?
In help topics there are only examples like this: 

... Data Source = 'SalesData.sdf'; ...

But this example is intended for SQL Server 2005 Mobile database located on desktop computer...

I need to custom data load from desktop to device and vice versa, so I did this:

string SqlMobileConnString = "Persist Security Info = False; Data Source = Mobile Device\CF Card\mBase.sdf; File Mode = 'shared read';";

SqlCeConnection
SqlMobileConn;
SqlMobileConn = new SqlCeConnection(SqlMobileConnString);
SqlMobileConn.Open();

// Exception!!! Invalid path... I tried to set path like this: "Data Source = My Computer\Mobile Device\..." and old variant with slash: "Data Source = \Mobile Device\...", but nothing was helpful... It's very strange because even SQL Server Management Studio uses this format: "Data Source = Mobile Device\..."

I only know that this format is intended to use from mobile applications:
"Data Source = \CF Card\...". It's quite simple and logically ...

So I don't know what to do... Please help!

P.S. Sorry for my english :)

Riven
\ should be escaped as \\ in C#.
Or please use verbatim strings by adding @ to the string.


This posting is provided "AS IS" with no warranties, and confers no rights.
Ilya Tumanov

Oh, string is ok, I forgot to set @ here (in code everything was OK).

But I've solved problem with connection!

I used namespace Microsoft.SqlServerCe.Client instead of System.Data.SqlServerCe, in which I found classes identical to classes from the latter one.

Instance of Microsoft.SqlServerCe.Client.SqlCeConnection class connected to my SQL Server 2005 Mobile database on PocketPC through ActiveSync and I viewed data from it on my desktop computer.

Only one question: Where I can find some detailed info about this namespace?
It is located in

C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\Microsoft.SqlServerCe.Client.dll

or

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\Microsoft.SqlServerCe.Client.dll

I've found no information about this namespace (as for me I've found it searching files *sqlserverce*.dll in My Computer :)

Maybe it is not documented yet...

Riven
Microsoft.SqlServerCe.Client.dll is not supported and hence not documented. 

Thanks,
Laxmi NRO, SQL Mobile, Microsoft


Please hit "Yes", if my post answered your question(s). All postings are as-is and confer no rights.
Laxmi NRO MSFT

in most instances,you have to replace SqlCommand with SqlCeCommand , XxxYxx with XxxCeYyy
(my app was for windows ce 5.0 for symbol 3000 handheld and pocket pc ).

  to connect ms sql management studio to .sdf file on visual studio seems to require the non express edition of the  sql management studio




ramzi www.rolamzi.com
ramzi hawa
reply 5

You can use google to search for other answers

 

More Articles

• SQL Server CE problem
• Access Database Synchronizer (ADS)
• Loosing database connection when device power-off (native oledb c...
• Migrating from 2005 to 2005 Mobile
• SQL Server Mobile Merge Replication walkthrough, cant find the .N...
• Adding SDF data into a Listview - C#
• How solid is Sql Server Everywhere?
• No Factory?
• Error Saving Binary data to sql mobile
• What is the difference in WM5 windbase.h and windbase_edb.h ?
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• The process could not connect to Distrib
• Microsoft SQL Server Mobile Edition data
• Test deploying WinForms app with SQL/e
• Upgrade scripts for SQL Server Mobile Da
• SQL Everywhere ConnectionString problems
• Create a Mobile database on desktop
• Change database attributes with SQL?
• Filter using a combobox
• strange problem with SQL Server CE 2.0
• Am i going the right way about this
• Sql Server CE 2.0 Proxy Replication Scen
• Bulk Insert performance
• Compact Sql Mobile 3.0 DataBase in C++/O
• ResultSet in Avalon (WinFX-WPF-.net3.0)
• a strange problem with RDA

Hot Articles

• cannot generate ResultSet code
• Insert GUID into SQL Mobile Database tab
• SSev and Enterprise Library
• Database connections
• Transactions in SQL CE and CF2.0
• How to make synchronize once instead of
• Can't see Designer view in Asp.net 2005
• Mobile Line of Business Solution Acceler
• sqlCeReplication.HostName size limit fix?
• (SQL Mobile)Can SELECT, but cannot INSER
• SQL Server Connection Error
• Access Database Synchronizer for SQL Exp
• How do I install SQL Server Management S
• Creating Reports on SQL Server 2005 Mobi
• Error during Synchronization

Recommend Articles

• Compact Database Error Code: 0
• using sql Mobile Databases
• My SQL application on Windows Mobile 5
• Can't find PInvoke sqlceme30.dll
• Client-side programming patterns/idioms
• Replication Error 28559
• connecting to sql server from mobile dev
• Problem in using EDB
• Making small database on iPaq
• Converting bytes [] to an SQL CE 3 image
• strange problem with SQL Server CE 2.0
• SQL CE Mobile in VS.Net server explorer
• When will SQL Everywhere integrate to th
• What directory would be best to store th
• Insert error on existing table