Profiling a Linq.DataContext without explicitly using GlimpseDbConnection

63 views
Skip to first unread message

Luke Merrett

unread,
Nov 7, 2013, 11:00:21 AM11/7/13
to getglim...@googlegroups.com
Hi guys,

We're using LinqToSQL and Glimpse with the connection set up like below:

if (ApplicationSettings.ProfileDatabaseQueries)
{
    var connection = new SqlConnection(connectionString);
    var conn = new GlimpseDbConnection(connection);
    context = new ApplicationDatabaseDataContext(conn, mappingSource);
}
else
{
    context = new ApplicationDatabaseDataContext(connectionString, mappingSource);
}

I read in this stack overflow post that if you use DbProviderFactories then Glimpse hooks in automatically rather than us having to before the switch using a web.config key.

Does anyone have any sample code showing how to achieve this with a System.Data.Linq.DataContext?  

As an aside do you need to explicitly add the provider in the connection string using this approach?

Regards,
Luke

Anthony van der Hoorn

unread,
Nov 8, 2013, 9:19:12 AM11/8/13
to getglim...@googlegroups.com
Replied on StackOverflow.


--
You received this message because you are subscribed to the Google Groups "GetGlimpse-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getglimpse-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Luke Merrett

unread,
Nov 8, 2013, 9:26:06 AM11/8/13
to getglim...@googlegroups.com
Thank you Anthony, I'll have a look


--
You received this message because you are subscribed to a topic in the Google Groups "GetGlimpse-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/getglimpse-dev/wYrAzNifDg4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to getglimpse-de...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
from Luke Merrett
Email:    lukeam...@gmail.com
Twitter:  @clickrex
LinkedIn: Profile

jatin khimani

unread,
Sep 17, 2015, 8:42:11 AM9/17/15
to GetGlimpse-dev, lukeam...@gmail.com
Hi

I get this glimpse error while i run my third party control.

Property accessor 'ServerVersion' on object 'Glimpse.Ado.AlternateType.GlimpseDbConnection' threw the following exception:'Invalid operation. The connection is closed.'

I get perfect data from repository but when DOM is try to bind it at that time it's throw error.
Do you have any idea about it how can i resolve it ? 

Thanks,
Jatin
Reply all
Reply to author
Forward
0 new messages