How to use my Firebird database already populated for a web project in Visual Studio 2015 using entity framework?

1

I have a Firebird database already populated and I would like to use this same base for a web project in visual studio 2015.

I installed Firebird ADO.NET Data Provider and tried to give a "connect to database" in visual studio, I selected "Firebird Data Source", I gave it but when I select the DB in the window "add conecction" the window closes and I have to restart the process in "connect to database".

How can I make this connection from my Firebird DB with VS?

Thank you.

    
asked by anonymous 26.01.2016 / 14:42

2 answers

1

This is the old way of working with the Entity Framework. The most current way uses only the web.config project file settings and NuGet packages.

The ADO.NET provider to Firebird and its Entity Framework support can be easily installed by using the following commands in the Package Manager Console ( View > Other Windows & gt ; Package Manager Console ):

PM> Install-Package FirebirdSql.Data.FirebirdClient
PM> Install-Package EntityFramework.Firebird

The setting in web.config is done as follows:

  <configuration>
    ...
    <entityFramework>
        <defaultConnectionFactory type="FirebirdSql.Data.EntityFramework6.FbConnectionFactory, EntityFramework.Firebird" />
        <providers>
            <provider invariantName="FirebirdSql.Data.FirebirdClient" type="FirebirdSql.Data.EntityFramework6.FbProviderServices, EntityFramework.Firebird" />
        </providers>
    </entityFramework>
    ...
  </configuration>

In addition, you need to provide a connection string in the same file:

<configuration>
  ...
  <connectionStrings>
    <add name="DefaultConnection" connectionString="User=usuario;Password=senha;Database=C:/caminho/do/arquivo.fdb;DataSource=localhost;Port=3050;Dialect=3;Charset=NONE;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet size=8192;ServerType=0;" providerName="FirebirdSql.Data.FirebirdClient" />
  </connectionStrings>
  ...
</configuration>

EDIT

For reverse engineering, install the DDEX provider in your Visual Studio. You can download it here .

    
26.01.2016 / 15:25
0

I was able to make the connection only the oldest way, creating a Connection String and accessing the DB through SQL calls. This will make it difficult for me to develop because I will not be able to use code first the way I would like it.

If someone else needs help with this same problem, follow the link that helped me. HERE!

    
29.01.2016 / 15:02