Error creating an executable distribution with sql database using Entity Framework

Asked

Viewed 98 times

2

I am developing a C# winforms desktop application in Visual Studio with Sql database through the Entity Framework. The intention is that it be a local database, the program will be installed on isolated machines, which have no access to any server. As always, on my machine works normal (laughs), but testing on other computers gives an error of connection to Sql Server.

I have been researching about it and I saw that as it is impossible to install Sql Server on each machine, it would be better to use Sql Server Compact. However, I saw that unlike Server Express that generates . mdf files, Compact works with . sdf files.

In this the best output would be to reconfigure the Entity Framework to generate a Compact Sql database or there is some other way to work with the database. Express mdf on a machine that does not have Sql Server Express installed?

  • 1

    try this one Download using the localdb with .mdf even

  • Hi, @Barbetta. In this case it would only be possible to access the flock if the host has localDb installed? There is no kind of Sql Server "Runtime" that is lighter and easier to install for the user?

  • Wow, when I went through the same problem, that was the only thing you solved. I do not know if my case has any peculiarity, because that at first I commented here. This ai is the service pack that brings the connectors to communicate with the localDb.

  • 1

    I ended up opting for Sqlite, for being a simpler solution for my case. Thanks, @Barbetta

  • I’ll tell you, this week I had to install the application on a weaker and older machine, I got hurt, I’m going the same way as yours.

  • 1

    @Barbetta, Cool! I’m glad to have cooperated in some way :)

Show 1 more comment

1 answer

1


I ended up finding a better solution for my need: Sqlite. Sqlite also supports the Entity Framework and is much simpler to use in a stand-alone application, requires no additional installation on the user’s machine and the package already generates the necessary dlls. For those interested in a tutorial, this Link there is a step-by-step way to configure and use Sqlite including with the Entity Framework.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.