Implementation of VB.Net SQLExpress 2008

I have been developing the application in the last 12 months using VS2008, VB.NET (WPF) and SQLExpress2008. It successfully works in one organization, but now I need to consider the possibility of its deployment in other organizations, where I will not know the connection string for the database, application locations, server locations, etc.

What is the current preferred approach for deploying dotNet applications using SQL Express 2008? ClickOnce? InstallShield?

Also, what's the best way to request connection string details. Should I write myself and possibly store the information in my.settings, are there any third-party db configuration applications that will make my life easier?

Sorry for all the questions, but on the bottom line, what is the best way to deploy my application!

+4
source share
2 answers

I take this from your mention of ClickOnce that it is not an ASP.NET application. Please correct me if I am wrong and edit your question.

I was able to create a simple installer using simple applications. I requested the server name and database name as separate parameters. In fact, in one setup, I was able to request a server name with one request form, Windows and SQL Server authentication using the switch for a second, then the user and password on the third if the "SQL Server" button was clicked. I passed the resulting values ​​as parameters to the small Installer class, which created the connection string from the individual parts.

In this particular case, I used the connection string right away to execute some SQL scripts, but you could just as easily save the connection string in app.config so that the program can be used later.

Another option, at least for a GUI program, is the settings dialog box, which can set the connection string and prompt the user to install it when it is not installed. It will not be installed the first time you start the program, so you can wait until the first time or run the program after installing it, request the necessary settings, and then simply install them and exit. This has the advantage of a better user interface and code reuse.

+2
source

Typically, these user interfaces are recreated each time by each developer, and only about 20% of the reasons resulting from the product can be used with the SqlConnectionString class as the back end object and make sure your validation checks the connection.

0
source

Source: https://habr.com/ru/post/1285877/


All Articles