1

I am trying to create a simple offline application for personal-use that uses a SQL Server Compact 3.5 database and I plan to use Linq-to-SQL to work with it. I have used SQLMetal (through the application SqlmetalBuilder) to create a dbml file, and have added it to my project.

The problem I am having is that, unlike the O/P Designer (which you cannot use on SQL Server Compact files), SQLMetal creates code that requires me to enter the connection string when instantiating a DataContext.

How do I find out what the connection string is? I have looked but I can't find the answer... And if there is a way to create the code so that I don't have to enter the connection string (this app is not to be distributed), any advice would be appreciated.

Gaijinhunter
  • 14,587
  • 4
  • 51
  • 57
  • 2
    Did you check out http://www.connectionstrings.com/? http://www.connectionstrings.com/sql-server-2005-ce – Ivo Oct 27 '11 at 11:10

1 Answers1

0

SqlMetal.exe (Code Generation Tool)

See Connection Options: /conn: connection string.

Update:

SQL Server Compact 3.5 and Visual Studio (look for connection string).

You can pass the connection string to the constructor of DataContext class.

Community
  • 1
  • 1