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

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
[email protected]
Posts: 43
Joined: Wed 17 Sep 2008 11:31

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

Post by [email protected] » 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
Last edited by [email protected] on Thu 17 Feb 2011 05:19, edited 1 time in total.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 23 Sep 2008 15:32

Please specify, are you using LINQ to MySQL Support or Entity Framework?

[email protected]
Posts: 43
Joined: Wed 17 Sep 2008 11:31

Post by [email protected] » Tue 23 Sep 2008 15:51

We're using the LINQ to MySQL Support.
________
Scepter
Last edited by [email protected] on Thu 17 Feb 2011 05:20, edited 1 time in total.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 26 Sep 2008 09:32

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.

Post Reply