2016-04-15 139 views
4

我正在努力在Visual Studio 2015中創建一個Firebird連接。我有一個C#類庫,我想用它來連接到Firebird數據庫。 我安裝這些插件從的NuGet:在Visual Studio 2015中爲Firebird提供的ADO.NET數據提供者

enter image description here

但是當我嘗試添加新項「ADO.NET實體數據模型」與「從數據庫EF設計師」,火鳥連接未列出: enter image description here

在互聯網上閱讀文章顯示machine.config中的條目應該已經被創建。但是這沒有發生。該配置文件中沒有Firebird條目。

Visual Studio項目中存在「FirebirdSql.Data.FirebirdClient」引用。

在App.config文件中的條目是:

<DbProviderFactories> 
     <remove invariant="FirebirdSql.Data.FirebirdClient" /> 
     <add name="FirebirdClient Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".NET Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient" /> 
</DbProviderFactories> 

我也安裝了SQLite的插件,只是爲了看看這個供應商行爲相同。事實上它並沒有在「選擇數據源」對話框中列出。我想我犯了一個普遍的錯誤。

有人可以幫我解決這個問題嗎?我如何創建一個數據庫連接到我的Firebird數據庫?

回答

3

如果您通過NuGet安裝驅動程序,它只能在您的項目中使用,您不能從Visual Studio本身使用它,因爲NuGet軟件包不會自行安裝到您的計算機上(因此不會修改machine.config)。

您需要安裝驅動程序和DDEX提供程序(版本3.0.2或更高版本),您可以從Firebird ADO.NET Data Provider downloads下載安裝程序。

+0

感謝您的快速響應。爲整個系統安裝FirebirdClient添加了一個條目到machine.config,但不幸的是沒有解決問題。根據http://www.firebirdsql.org/en/news/ddex-provider-3-0-1-for-firebird-released-38018/,DDEX提供者不適用於VS2015。該頁面上的下載鏈接只是指NuGet的FirebirdSql.Data.FirebirdClient。 – telandor

+0

@telandor我建議你也可以在Firebird.net提供商的郵件列表上提問;我不經常使用Visual Studio,所以我不知道讓這個工作的所有細節。 –

+1

DDEX供應商支持VS2015 – magicandre1981

0

我無法讓它工作。似乎Firebird 3的ADO.NET提供程序已使用Visual Studio 2017(具有C#7.0功能)進行編譯,並且正在使用Visual Studio 2015.由於我們使用的一些工具無法輕鬆升級到2017年。

相關問題