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

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

Postby itcore@vit.ch » 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 itcore@vit.ch on Thu 17 Feb 2011 05:19, edited 1 time in total.
itcore@vit.ch
 
Posts: 43
Joined: Wed 17 Sep 2008 11:31

Postby Shalex » Tue 23 Sep 2008 15:32

Please specify, are you using LINQ to MySQL Support or Entity Framework?
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby itcore@vit.ch » Tue 23 Sep 2008 15:51

We're using the LINQ to MySQL Support.
________
Scepter
Last edited by itcore@vit.ch on Thu 17 Feb 2011 05:20, edited 1 time in total.
itcore@vit.ch
 
Posts: 43
Joined: Wed 17 Sep 2008 11:31

Postby 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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL