DBMonitor not working properly

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

DBMonitor not working properly

Post by [email protected] » Tue 26 May 2009 06:30

Hello

I am developing ASP.NET applications with the ASP.NET Development Server (not with IIS) and I'd like to monitor my LINQ statements. Unfortunately the monitoring with the DBMonitor is very unreliable. Sometimes it traces some SQL statements and sometimes nothing is traced. Sometimes the monitoring works only after many trials.

Right now I have a problem where I can try as much as I want, but nothing will ever be monitored. I ensured to start DBMonitor first and then start the debug session of my Visual Studio where I instantiate MySQLMonitor and set the IsActive property to true.

Is there anything I can do about this? Are there other (more reliable) ways to monitor the generated SQL statements of my LINQ statements?

Best regards

PS: Maybe monitoring is the wrong approach. When developing Microsoft LINQ, I use LINQPad (www.linqpad.net) to debug my linq statements. This tool is absolutely great. You should contact them and encourage them to implementyour MySQL LINQ provider.
________
Brunette schoolgirl
Last edited by [email protected] on Thu 17 Mar 2011 10:11, edited 1 time in total.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 26 May 2009 06:49

You can use the Datacontext.Log property for monitoring SQL statements generated by LINQ to MySQL.
To implement this you can add the code like the following:

Code: Select all

DataContext1 db = new DataContext1();
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
db.Log = sw;
...
string log = sb.ToString();

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

Post by [email protected] » Tue 26 May 2009 06:52

Is it possible that DBMonitor does not support complex queries?

I just found out that monitoring of this statement is working:

Code: Select all

var recordSet = (from m in PPCustomer.Mailings
                         select m);

int totalMailings = recordSet.Count();
but this one is not working...

Code: Select all

var recordSet = (from m in PPCustomer.Mailings
                         join mr in PPCustomer.MailingRecipients on m.MailingId equals mr.MailingId
                         select m);

int totalMailings = recordSet.Count();
________
Maine Dispensaries
Last edited by [email protected] on Thu 17 Feb 2011 05:22, edited 1 time in total.

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

Post by Shalex » Wed 27 May 2009 12:27

We cannot reproduce the problem.

1. Please specify your versions of dotConnect for MySQL and DbMonitor:
- the Tools | MySQL | About menu of Visual Studio;
- the Help |About menu of DbMonitor.

2. Are there any other statements that are not shown in DbMoniror?

3. Please describe the situation when it doesn't work. You have the MySqlConnection object in DbMonitor, but there is no MySqlCommand object, is there? Or MySqlCommand is shown in DbMonitor, but it doesn't contain the statement that was executed?

Post Reply