Solved

Newbie deploying VB.net / SQLExpress app

Posted on 2007-03-23
2
898 Views
Last Modified: 2010-05-18
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..)??
0
Comment
Question by:noobe1
2 Comments
 
LVL 42

Accepted Solution

by:
dqmq earned 500 total points
Comment Utility
1. Run CREATE DATABASE ... FOR ATTACH
2. You can't determine it from the client. The name is determined during installation of SQL Server. However, \\NetworkName\.\SQLExpress finds the default database
3. Probably
4. Generally speaking, you would do that kind of work in a development environment, not on the production server.  When all has been tested, then you either reinstall or upgrade. Either way, for most changes of that nature you would need to take the app out of service and coordinate the database changes with the application changes.
0
 

Author Comment

by:noobe1
Comment Utility
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
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now