views:

156

answers:

4

Right now I have my program running on my SQLExpress database. But what I'd really like is for my program to run on any machine as long as A DATABASE FILE is in the same folder. How can I accomplish this?

Firs things's first: How would my connection string be if I were connecting to a FILE DATABASE?

Second: How do I create a single file database from an existing SQLExpress database?

A: 

you could use sqlite3 (file DB)

RC
A: 

Sql Server is a server-class engine. If you want it to run on any machine you need to choose an in-process database engine like Sql Server compact edition, sqlite, or even access, where you can easily distribute the engine with your app.

Joel Coehoorn
+2  A: 

Just like stated above, SQL Server is a server-class database engine. There are some smaller solutions called 'in memory databses' (so they do rely only on a database file) that you may want to use:

Which one to choose? Well, it may be easier for you to transform your SQL Server data int SQL Server Compact than to SQLite. Be aware, that those databases are quite simple, and some things may be missing (stored procedures, funcions... - just take a look at documentation and specification).

MaciekTalaska
+1  A: 

You can use AttachDBFilename and UserInstance=True.

Cade Roux

related questions