Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Newbie deploying VB.net / SQLExpress app

Posted on 2007-03-23
2
Medium Priority
?
914 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

604 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