无法加载“Microsoft.Data.ConnectionUI"供 DataConnectionDialog 使用 [英] Unable to load 'Microsoft.Data.ConnectionUI" for DataConnectionDialog use

查看:27
本文介绍了无法加载“Microsoft.Data.ConnectionUI"供 DataConnectionDialog 使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 C#、.Net 4.0 创建了一个应用程序.在这个应用程序中,我需要显示一个用于访问数据库的 DataConnectionDialog.

I created an application in C# , .Net 4.0. In this application i need to show a DataConnectionDialog for accessing DataBase.

我使用此代码:

 DataConnectionDialog BDdialog = new DataConnectionDialog();
 DataSource.AddStandardDataSources(BDdialog);
 BDdialog.SelectedDataSource = DataSource.OdbcDataSource;
 BDdialog.SelectedDataProvider = DataProvider.OdbcDataProvider;
 DataConnectionDialog.Show(BDdialog);

在我的笔记本电脑上,代码运行良好,但在另一台笔记本电脑上,使用 .Net 4.0 和 .Net 4.5 时,当我尝试打开此对话框时出现异常:

On my laptop, the code works fine, but on another laptot, with .Net 4.0 and .Net 4.5 there is an Exception when i try to open this Dialog :

尽管如此,我还是将这些 DLL 添加到了我的 exe 目录中:

Nevertheless, i added these DLL in the same directory of my exe :

Microsoft.Data.ConnectionUI.Dialog.dll
Microsoft.Data.ConnectionUI.Dialog.resources.dll
Microsoft.Data.ConnectionUI.dll

谁能帮帮我?请如何更正此错误?

Anyone could help me ? How correcting this error please ?

非常感谢,

最好的问候,

尼克斯

推荐答案

您可以从 Nuget 源获得这些库文件.

You get these libraries files from Nuget source.

https://nuget.org/packages/DataConnectionDialog/1.2

这篇关于无法加载“Microsoft.Data.ConnectionUI"供 DataConnectionDialog 使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆