Unable to load 'Microsoft.Data.ConnectionUI" for DataConnectionDialog use

对着背影说爱祢 提交于 2019-12-02 12:19:43

问题


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

I use this code :

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

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 :

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 ?

Thanks a lot,

Best regards,

Nixeus


回答1:


You get these libraries files from Nuget source.

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



来源:https://stackoverflow.com/questions/17469960/unable-to-load-microsoft-data-connectionui-for-dataconnectiondialog-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!