Link to home
Start Free TrialLog in
Avatar of noobe1
noobe1

asked on

Newbie deploying VB.net / SQLExpress app

Hi Experts,
I developed an app using VB.net and SQLExpress. Now, I need to deploy my application. I have a few questions:

1) When the application is first installed on a server, how do I make SQLExpress attach the database
2) On client machine, I need to modify the connection strings in the config to point to the server. How do I determine the server's name?
3) Should I create two installer?? One for server and one for client machine?
4) If after installing the app on the server, how do I make changes to the db (ie add/delete  table, columns etc..)??
ASKER CERTIFIED SOLUTION
Avatar of dqmq
dqmq
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of noobe1
noobe1

ASKER

I created the following script with SQL Server Management Studio:

USE [master]
GO
CREATE DATABASE [RESUMEDB] ON
( FILENAME = N'C:\Program Files\XYZ\TestDB.mdf' ),
( FILENAME = N'C:\Program Files\XYZ\TestDB_log.ldf' )
 FOR ATTACH
GO
if not exists (select name from master.sys.databases sd where name = N'TESTDB' and SUSER_SNAME(sd.owner_sid) = SUSER_SNAME() ) EXEC [TESTDB].dbo.sp_changedbowner @loginame=N'HPZE4100\p', @map=false
GO

How do I make VB.net execute the script after installation is complete?
Thanks