Create firebird data source in Visual Studio

2019-03-04 09:38发布

I have an app in c# using Visual Studio 2010 express and realized the sqlce database i was using does not meet all of our needs.

I am trying to figure out how to add a firebird datasource and point to my firebird database. I want to mimic the sqlce dataset creating a new dataset but with designer. I think my first step needs to be getting the data source added but I can't figure out how to do it. Any ideas?

I tried following this article: http://www.ibprovider.com/eng/documentation/firebird_adonet/p2_visual_studio_2008.html#server_explorer as well as additional links within this article but have not had luck. I tried installing the ibprovider professional suite and it looks like it insalled as i see it in program files but I am not certain what it is doing exactly. I also installed a odbc provider from the easysoft.

Any help would be appreciated.

1条回答
迷人小祖宗
2楼-- · 2019-03-04 10:35

It's been a while since I've done this. I do remember making changes to the machine.config. Look at these, these instructions sound familiar. http://www.basarat.com/2010/02/setting-up-firebird-development-with-vs.html http://www.basarat.com/2010/05/setting-up-portable-firebird-full-with.html

edit: I just installed it, this is what I did:

  • I downloaded the latest FireBirdClient.msi and DDEX provider from here.
  • Installed the .msi and extracted the DDEX zip.
  • Used the Visual Studio Command prompt and navigated to C:\Program Files (x86)\FirebirdClient.
  • Did gacutil /i FirebirdSql.Data.FirebirdClient FYI, after the .dll doesn't show up in the gac for some reason
  • Then, gacutil /l FirebirdSql.Data.FirebirdClient and left it open so I could copy the Version and PublicKeyToken later.
  • I modified my machine.config in C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG AND C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and followd these instructions.

Note: %RuntimeVersion% vs. %Version%

<configuration>
  <configSections>
    ...
    <section name="firebirdsql.data.firebirdclient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=%RuntimeVersion%, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    ...
  <configSections>
...
  <system.data>
    <DbProviderFactories>
      ...
      <add name="FirebirdClient Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".Net Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient, Version=%Version%, Culture=%Culture%, PublicKeyToken=%PublicKeyToken%" />
      ...
    </DbProviderFactories>
  </system.data>
</configuration>

And substitute (these informations you can find using gacutil):
  - %RuntimeVersion% with either 2.0.0.0 (.NET 2.0, .NET 3.0, .NET 3.5) or 4.0.0.0 (.NET 4). 
  - %Version% with the version of the provider assembly that you have in the GAC.
  - %Culture% with the culture of the provider assembly that you have in the GAC.
  - %PublicKeyToken% with the PublicKeyToken of the provider assembly that you have in the GAC.
  • From the DDEX extract I copyied the two .dll's FirebirdSql.VisualStudio.DataTools.dll and FirebirdSql.VisualStudio.DataToolsUI.dll to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE.

  • The last thing I did was modify the 2 registry files from the DDEX extract changing the path for each to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\I\DE\FirebirdSql.VisualStudio.DataTools.dll and merged them.

edit: adding this as a reference noted by bline22 in the comments.

查看更多
登录 后发表回答