?
Solved

Newbie deploying VB.net / SQLExpress app

Posted on 2007-03-23
2
Medium Priority
?
909 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 42

Accepted Solution

by:
dqmq earned 2000 total points
ID: 18778118
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
ID: 18784432
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

765 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