Linq to SQL and PostgreSql Profiler

Linq to SQL and PostgreSql Profiler

Postby Lucas Phillip » Thu 10 Nov 2011 15:45

Greetings all!

I'm trying to run a insert a bunch of data into postgresql using linq to sql but i'm getting a "foreign key restriction". And I can't figure out what's wrong because the exception code does not show me anything usefull (like, which row is bugging).

Is there a way for me to profile linq to sql execution, in order to see a little more about the error?

Lucas Phillip
Posts: 10
Joined: Wed 29 Jun 2011 14:37

Postby StanislavK » Fri 11 Nov 2011 18:00

For example, you can check the SQL generated for your commands. For the detailed information about this, please refer to the 'Monitoring' topic of our documentation:

This error may occur, e.g., if a foreign key is nullable, whereas the corresponding property in the model is not. In this case, new rows may be inserted with default (e.g., zero instead of null) values in the foreign key columns, leading to the constraint violation.
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Return to LinqConnect (LINQ to SQL support)