2010中使用数据库创建MySql

2010中使用数据库创建MySql

本文介绍了使用.Net framework 4.0创建安装程序,在Visual Studio 2010中使用数据库创建MySql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我需要创建一个安装文件,其中包括.Net framework 4.0,MySql Odbc Connector,带数据库的MySql Server和Windows应用程序。当客户端在他的系统中单击此设置时,它需要在系统中静默安装以上四个组件,即无需手动安装所有4个组件,它需要按顺序安装所有这些组件。



请帮我解决这个问题。我对这个概念很新,所以请逐步解释。

Hi Everyone,

I need to create a setup file which includes .Net framework 4.0, MySql Odbc Connector, MySql Server with Database, and Windows application. When client clicks this setup in his system, it needs to install all above four components in the system silently i.e without manually installing all 4 components, it needs install all these in order.

Please help me to how to do this. I am very new to this concept, so please explain step by step.

推荐答案

"mysql.exe --host=" + txtHostIP.Text + " --user=" + txtUserName.Text + " --password=" + txtPassword.Text+ " --port=" + txtPort.Text + " --default-character-set=utf8 --comments < " + SqlScriptFile);





使用以下代码执行批处理文件。





Execute the batch file using the following code.

ProcessStartInfo info = new ProcessStartInfo(_installBatchFile);
     info.UseShellExecute = false;
     info.RedirectStandardError = true;
     info.RedirectStandardInput = true;
     info.RedirectStandardOutput = true;
     info.CreateNoWindow = true;
     info.ErrorDialog = false;
     info.WindowStyle = ProcessWindowStyle.Hidden;
     info.WorkingDirectory = GetPathOfMySqlService();//Get MySql.exe(program files) path
     Process process = Process.Start(info);


这篇关于使用.Net framework 4.0创建安装程序,在Visual Studio 2010中使用数据库创建MySql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 02:41