Sample Header Ad - 728x90

Trying to connect to PostgreSQL with Entity Framework via Npgsql and C#

4 votes
4 answers
20142 views
So, I'm new to databases and only have done a little with PostgreSQL before. I have C# (visual studio 2012) and have downloaded the Entity framework (6). I have also downloaded the latest Npgsql data connection driver and used this tutorial: Using Entity Framework 6 with Npgsql 2.1.0 Now I have of course installed PostgreSQL and referenced the two dll's in my C# project: npgsql.dll and npgsql.entityframework.dll Now I need to know how to add, view, delete stuff via C# but I can't find any material on using C#, Npgsql and Entity Framework together. With no material on using Npqsql and Entity Framework 6, I have instead found this tutorial for version 5: Create Entity Data Model in Entity Framework 5.0 However, under choose your data connection, when I add a new connection, there is no option to use Npqsql. I really am confused and have been trying to control PostgreSQL via C# for about a week now, I have tried almost every link I can find on Google and am close to giving up. A lot of tutorials show how to drive PostgreSQL directly via Npgsql without using Entity Framework, but I really wanted to use the Entity Framework because I've been told it makes manipulating the database much easier.
Asked by Joseph (63 rep)
Aug 2, 2014, 03:46 PM
Last activity: May 6, 2018, 04:56 AM