我有一些库文件需要我的应用程序工作.
我的应用程序包含设置和部署.
我已经知道,为了在安装时将库文件添加到应用程序的输出目录中,我只需要在构建之前引用.NET IDE中的那些库...唯一的问题是这些库不能引用...所以我需要能够将这些库复制到我的应用程序的安装目录...目前,我正在手动复制这些库...
附录
我也尝试将这些库文件作为现有项添加到我的项目中,并标记每个库文件' 复制到输出目录以复制,如果它们的属性更新但仍然没有得到我想要的解决方案.
更新1
谢谢你帮助我帮助我解决问题,我设法让你发布的解决方案工作除了一个... @Matthew Watson的帖子..我甚至设法找到了解决方案,所以我想和你分享它.
继承人我做了什么:
1. I opened the setup and deployment project in my application.
2. Under the Application Folder Tree, on it's right side, I right clicked..
3. then clicked Add..
4. then clicked File
5. and then browsed for the files I wanted to add to the installation directory
6. and click open.
Run Code Online (Sandbox Code Playgroud)
但出于好奇......我仍在努力让@Matthew Watson发布工作......希望你能帮助我这一个人.提前致谢
更新2
我昨天忘了更新这篇文章,我已经设法让Matthew Watson的解决方案昨天工作了.再次感谢您的帮助.
通常,当我需要使用C#连接到数据库时,我将使用以下命令例程:
- 定义一个mysql连接.
- 打开一个mysql连接.
- 定义一个sql语句/查询.
- 使用MySqlCommand执行查询.
示例代码:
string con1 = "server=<db1 IP>;User Id=user;password=password;Persist Security Info=True;database=db1";
string con2 = "server=<db2 IP>;User Id=user;password=password;Persist Security Info=True;database=db2";
MySqlConnection cn1 = new MySqlConnection(con1);
MySqlConnection cn2 = new MySqlConnection(con2);
MySqlCommand com
cn1.Open();
string sql = "some query";
com = new MySqlCommand(sql, cn1);
com.executeNonQuery();
cn1.Close();
Run Code Online (Sandbox Code Playgroud)
我上面的问题是在我使用MySqlCommand命令的部分,因为它是指示数据库连接的位置,以便它现在将查询哪个数据库
MySqlCommand com = new MySqlCommand(sql, con);
Run Code Online (Sandbox Code Playgroud)
其中sql是sql语句,con是用于查询的连接.
如何在一个sql语句中查询两个数据库?
请考虑以下事项:(我正在使用MySQL)
- I have two databases, db1 and db2.
- db1 is located in City A
- db1 is located …Run Code Online (Sandbox Code Playgroud)