简体   繁体   English

使用MYSQL数据库部署C#程序

[英]Deploying C# program with MYSQL database usage

Hi all I was given assignment by the database teacher and i had to make UI and interface that with MYSQL . 大家好,数据库老师给了我作业,我必须使用MYSQL制作UI和界面。

I did it by installing mysql connector. 我通过安装mysql连接器来做到这一点。 Now the problem is that i donot know that he has it on his computer or not.I am sure he has installed MYSQL ,SQLYOG and SQL workbench on his system but no visual studio. 现在的问题是我不知道他是否在自己的计算机上安装它。我确定他已经在系统上安装了MYSQL,SQLYOG和SQL工作台,但没有安装Visual Studio。

if i give him Visual Studio Solution that is not going to work so i planned to make setup Project but there was a confusion that will it work at his system? 如果我给他无法使用的Visual Studio解决方案,那么我计划进行安装项目,但是有一个困惑,那就可以在他的系统上工作吗?

any idea how this could be sorted? 知道如何将其排序吗?

instead of referencing the MySQL connector from the GAC, create a folder called references in the source code folder, copy the connector there, remove the refence to it from the gac and re-add the reference from your local folder, build, test... 而不是从GAC引用MySQL连接器,而是在源代码文件夹中创建一个名为references的文件夹,在其中复制连接器,从gac删除对它的引用,然后从本地文件夹中重新添加引用,进行构建,测试。 。

Then close Visual Studio and zip the folder with source code and reference subfolder and send it to him by email. 然后关闭Visual Studio并用源代码和参考子文件夹压缩文件夹,然后通过电子邮件将其发送给他。

Set the Copy Local property of the MySQL reference(s) to true . 将MySQL参考的Copy Local属性设置为true

For example, if your project contains a reference to MySql.Data then right-click it and select Properties. 例如,如果您的项目包含对MySql.Data的引用,则右键单击它并选择“属性”。 In the Properties window you will see the Copy Local property. 在“属性”窗口中,您将看到“ 复制本地”属性。 Simply set it to be true . 只需将其设置为true即可 Then instead of searching the Global Assembly Cache (GAC) of the target machine for the MySql.Data.dll your executable will look for it in the same directory as it is located. 然后,无需在目标计算机的全局程序集缓存(GAC)中搜索MySql.Data.dll,您的可执行文件将在与该文件相同的目录中查找它。

See here for more details on the Copy Local property. 有关“复制本地”属性的更多详细信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM