Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey guys!

I'd really like to know what's the right connection string to connect to SQL Server Compact.

I was using this string to connect in the local file .SDF, but now I need to connect using a remote server, because I can't install the server in this machine.. is that possible? if yes, please could you help me with the connection string?

C#
connectionString="Data Source=test.sdf;Password=test123; Persist Security Info=False;"


So, I install the server in the second machine, and in the current, I can't, now, is that possible connect using the installed server in the second? As a server must act..

Sorry for my english.

i've tried this, but i know it's wrong

C#
connectionstring="Data Source=SOMINATRIS\\SQLEXPRESS;Initial Catalog=test.sdf;Persist Security Info=False" 


Thanks in adv!
Posted
Updated 13-Nov-11 12:30pm
v3

1 solution

Have you checked the docs or even the site; http://www.connectionstrings.com/sql-server-2005-ce[^]

Basically just pass in a fully qualified path to the database file as in "\\server\share\path\dbfile"
 
Share this answer
 
v2
Comments
fabriciobn 13-Nov-11 19:16pm    
Thank you so much!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900