Foreign Keys - how to enable? vb.net

Foreign Keys - how to enable? vb.net

Postby mwmeeks » Wed 19 Apr 2017 03:06

In vb.net 2017 - SQLite - I can setup a connection like this:

_connection = New SQLiteConnection("Data Source=" & database & ";foreign_keys = true")

However - using dotConnect SQLite - I can not do it like this - errors.
Is there a simple way to turn it on? - because the help file is so confusing - you could try 100 different ways and still get it wrong. For the life of me - as common as fk's are - it should be something that is easily handled without reading through weeds of help - that doesn't show the (exact) correct example!

Thanks
mwmeeks
 
Posts: 1
Joined: Wed 19 Apr 2017 02:39

Re: Foreign Keys - how to enable? vb.net

Postby Pinturiccio » Wed 19 Apr 2017 15:29

There is no such connection string parameter as foreign_keys in dotConnect for SQLite. That’s why the error is generated. dotConnect for SQLite’s SQLiteConnection has another connection string parameter: Foreign Key Constraints. For more information, please refer to https://www.devart.com/dotconnect/sqlite/docs/?Devart.Data.SQLite~Devart.Data.SQLite.SQLiteConnection~ConnectionString.html

This parameter can have one of the following three values: On, Off, Default. You need to replace the "foreign_keys = true" with "Foreign Key Constraints = On". For more information, please refer to https://www.devart.com/dotconnect/sqlite/docs/?Devart.Data.SQLite~Devart.Data.SQLite.SQLiteForeignKeyConstraints.html
Pinturiccio
Devart Team
 
Posts: 1893
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for SQLite