I want install my Windows application at my client location. It is a multiuser application. 10 systems with 1 server. So I install client setup on all the 10 systems and service setup on the server system.
How to secure my database in client server? I am using VS2010 and SQL Server 2008 R2. With out installing SQL Server Management Studio Express, how to install my database? And how to add my database in service setup? Can anybody show me an example for this type of application?
windows installer does not have any out of the box support to deploy database with along with the application, You will have to write your own component which creates the database during the deployment and plug it in with the MSI. I have done the same in my project. follow the steps.
Creating database with Console App
SMO(SQL server Management Object)
or simple Sql Command to execute script. Executing console app during the installation
Code
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
Process process = new Process();
ProcessStartInfo info = new ProcessStartInfo();
process.StartInfo = info;
info.FileName = Path.Combine(this.Context.Parameters["targetdir"], "ConsoleApp.exe");
info.UseShellExecute = false;
process.Start();
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.