On this msdn site (https://msdn.microsoft.com/en-us//libra ... .110).aspx) I read about the EnforceConstraints property.
However the PgSqlDataTable doesn't have this property (https://msdn.microsoft.com/en-us//libra ... .110).aspx) exposed.
I tried to access it like this:
Code: Select all
pgSqlDataTable1.DataSet.EnforceConstraints = false;
Could you please tell me how I can disable Constraints in PgSqlDataTable?
The reason I want to deactivate it is the following:
I am using this database:
http://www.postgresqltutorial.com/postg ... -database/
I installed the database like this:
http://www.postgresqltutorial.com/load- ... -database/
I drop a PgSqlConnection and PgSqlDataTable on the form.
The select command query text is:
Code: Select all
select fa.actor_id from film_actor fa
join film f on f.film_id = fa.film_id
the expected result would be: http://i.imgur.com/9vimI4U.jpg
I found out that when I activate, deactivate and then activate the Active property in the property grid there is a Constraint created: http://i.imgur.com/G7B7MeM.png
When I delete that constraint the result is as expected: http://i.imgur.com/M5CKX7N.jpg
However when I set the PgSqlDataTable back to active, the constraint gets created again and the following error appears: http://i.imgur.com/O4uDQow.png
Therefore the best solution for me would be to access the EnforceConstraints property and set it to false.
Best regards,
Chris