简体   繁体   中英

Connection string of SQL Server 2008 R2 silent install

I have a Windows application that works with a local database (SQL Server 2008 R2). I'm trying to create an install for my application.

I want the installer check if SQL Server 2008 R2 is available in user system, installer doesn't install SQL Server and if there isn't any version of that the installer install a new version.

But my users can't install SQL Server, so I need to install it in silent mode

Now I create a setup project in VS2010 that install SQL Server in silent mode ...

Two questions :

  1. does the installer check for another version of SQL Server ? (I mean check if is available ...)

  2. what will be the connection string after installing SQL Server? (if it just install one time in each PC so I can have one unique connection string in all pc)

  1. Yes you can check it by specifying a launch condition in your setup project Launch Condition: To create and manage launch conditions, you use the Launch Conditions editor in Visual Studio. You can access this tool by selecting your project in Visual Studio and then clicking the View menu. You will see an Editor submenu that contains several setup editors, including those for Registry, File System, File Types, User Interface, Custom Actions, and Launch Conditions
  2. You should set the connection string in your application as string connectionstring ="datasource = .; Initial Catalog = |DataDirectory|\\DBName.mdb;Integrated Security=SSPI I think this connection string will work. and if you are installing an sql sever express edition then

    string connectionstring ="datasource =.\\SQLExpress; Initial Catalog = |DataDirectory|\\DBName.mdb";Integrated Security=SSPI;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM