Page 1 of 1

How to disable foreign key checks when using MyDirect .NET?

Posted: Wed 17 Sep 2008 14:32
Hello

Is there a way to disable foreign key checks for delete statements when using LINQ?

I tried it this way:

int result = MediaflowMySqlDb.ExecuteCommand("SET FOREIGN_KEY_CHECKS=0;");
User user= new User () { User Id= 1 };
TestDb.Templates.Attach(user);
TestDb.Templates.DeleteOnSubmit(user);
TestDb.SubmitChanges();

But the ExecuteCommand gives an exception about the argument types not matching. Is this a beta bug or how is ExecuteCommand intended to be used? Where can I find the documentation about this method?
________
Digital scales

Posted: Tue 23 Sep 2008 15:32
by Shalex
Please specify, are you using LINQ to MySQL Support or Entity Framework?

Posted: Tue 23 Sep 2008 15:51
We're using the LINQ to MySQL Support.
________
Scepter

Posted: Fri 26 Sep 2008 09:32
by Shalex
Look forward to the next build of Devart LINQ Support Beta that will be available in a few days. It will be possible to override the protected virtual void InitialzeConnection(IDbConnection query) function in Devart.Data.Linq.DataContext.