Embed SQL2K5 Express into windows apps

  • Thread starter Thread starter carol chen
  • Start date Start date
C

carol chen

I have developed a desktop applicatio with synchronization feature. I wanna
embed
the sql into my application, and have following questions:

1. I can't just attach the database file (.mdf) as connectivity components
are required for sync function, right?

2. When install the sql2k5 express, the default instance is
MachineName/SQLEXPRESS, is there anyway to set it to Local/SQLEXPRESS?

3. Is there any sample code on the Internet in Visual Basic I can look at?

Any help and advice are very much appreciated!!

Carol
 
As part of the connection string, you can pass in a parameter in the connection
string that indicates the database to be used without
providing a server name. Or you can use the "." for the server name, which
denotes the local computer.

"Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;"


Connection string pulled from :
http://www.connectionstrings.com/


Morgan
 
Take a look at Sql 2005 Everywhere which is the desktop version of Sql
Mobile (unfortunately still under CTP).
This allow the application to host a lighter sql engine that can replicate
against a sql server 2005 (or 2000). The advantage is that you do not have
to "install" a sql engine on the client computer, and the engine is good
enough to hold some small databases.

Hope that helps
Steve
 
Back
Top