Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6871113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:45:57+00:00 2026-05-27T03:45:57+00:00

I’ve been experimenting with using mvc-mini-profiler on a ASP.NET website. All of the request

  • 0

I’ve been experimenting with using mvc-mini-profiler on a ASP.NET website. All of the request profiling works perfectly, but now I’m trying to see if there is a way to hook it into our database calls.

All of our database calls on our website are done by using typed datasets (.xsd files) with table and query table adapters. Is it possible to somehow hook in the mvc-mini-profiler to these datasets?

I understand that you would typically get some sort of dbconnection (SqlConnection, etc.) and then wrap that with the profiler’s ProfiledDbConnection. I just don’t know how to do this with a dataset, is it even possible?

Note: changing from using datasets to linq2sql or some other way would not really be feasible as this is a rather large project that has been around for some time.

Example database call

DAL_ClientTableAdapters.ClientTableAdapter tba = new DAL_ClientTableAdapters.ClientTableAdapter();
DAL_Client.ClientDataTable dt = tba.GetData();

Where there is a DAL_Client.xsd file containing a table adapter called Client which uses a connection string defined in the web.config

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:45:57+00:00Added an answer on May 27, 2026 at 3:45 am

    As Darin Dimitrov pointed out, you can’t really do it. You can modify the code generator to set the TableAdapter’s Connection property public, so you could pass in your own Connection. But SqlConnection is a sealed class, so you can’t extend it by adding profiling hooks to it…

    Possible workarounds:

    1. You can get basic timing information by add profiling "steps" around your db calls. But you get no special highlighting in the UI, total SQL time, or details about the command(s) and parameter(s) of the query like you get for regular db calls. If these are important, I think you could extend the miniprofiler code to help with timings. I think Something like this:

      DAL_ClientTableAdapters.ClientTableAdapter tba = new DAL_ClientTableAdapters.ClientTableAdapter();
      DAL_Client.ClientDataTable dt = null;
      //if you are not familiar with miniprofiler Steps, this adds the elapsed time between the curly braces to your timing information
      using(MiniProfiler.StepStatic("Executing GetData() from 'Client' table")) {
          dt = tba.GetData();
      } 
      

      Here is what you would get:
      Basic timing information about your db call

    2. Try to change the code generator to add DbConnection into the generated files instead of SqlConnection. Don’t know if the typed datasets, or your code uses anything SqlConnection specific, but sound pretty risky for an old and large project…

    3. Try to use Moles to insert profiling hooks to SqlConnection. OK, not exactly serious about this…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.