Profiling on SQL Server Express

October 19th, 2011

I’m working on a new web app using ASP.NET MVC 3 and Entity Framework 4.1. One thing lacking in EF 4.1 is the ability to monitor the actual queries sent to the SQL database, like you could do with Linq2SQL’s DataContext.Log.

The machine I’m working on has SQL Server Express. The Express version doesn’t come with the SQL Profiler. So without Profiler and without a log function on Entity Framework’s DbContext, what’s a developer to do?

Well, as it turns out, profiling is part of the SQL Server (any version, including Express), the SQL Profiler application is just one way to access the profiling functionality. Some people even argue it’s better to do the profiling on the server itself, as opposed to through SQL Profiler.

Starting the trace

How do you start? The easiest way to start is (you’re not going to like this) by using SQL Profiler. That’s what I did (on another machine). It’s explained on the website linked above, here are the steps: Read the rest of this entry »

Fighting “General SQL Error” in Dynamics CRM custom workflows

September 22nd, 2011

Working for my client Valx, I had some serious problems in custom workflows for Microsoft Dynamics CRM 4. Every now and then, a workflow would throw a SoapException. I always put the original exception in the InvalidPluginExecutionException (second parameter “inner exception”). Now the actual exception information you want to see is in SoapException.Detail, which is an XmlNode. You won’t see that info if you just put the SoapException in the InvalidPluginExecutionException’s inner exception. Therefore, I use the following try/catch construction in each custom workflow’s Execute method to see some relevant information in the WorkflowLog view of the Dynamics CRM database.

Read the rest of this entry »

PDF watermark/background Rendering Extension for SSRS – Part 2

February 11th, 2011

Updated 2011-02-22: the underlying Stream is closed when PdfWriter.Close() is called, so the code for the PdfHandler.AddBackgroundPdf() method is updated (line 79 and further).

Well, I didn’t think this follow-up to Part 1 would come this quick, but here it is! Again I would like to emphasize that Jan Hoefnagels is the one who should take credit for this solution, but he isn’t the blog-writing type of guy. He’s not even a “Getting Things Done” guy. He’s a “Making Things Work” guy. And he’s pretty good at that.

Anyway, Part 1 showed you a general solution for an implementation of a Rendering Extension for SQL Server Reporting Services that was able to utilize the built-in (Microsoft provided) PDF Renderer, while enabling you to get the rendered PDF and do “something” with it, before sending it back to the SSRS server, which would subsequently send it to the end-user as a downloadable PDF file. That was a long sentence by English standards, but by Dutch standards, that’s kind of like a normal length. In German however, you would just be getting started. This whole article could be one sentence in German and still leave room for more.

Read the rest of this entry »

PDF watermark/background Rendering Extension for SSRS – Part 1

February 9th, 2011

While working on a Dynamics CRM implementation for Valx —whose website was made by Jan, Zlatan and me with Umbraco— with my dear friend and “colleague” Jan Hoefnagels, we stumbled upon a technological hurdle.

We promised our client quotes, orders and invoices —as generated by SQL Server Reporting Services, which is neatly integrated into Dynamics CRM— with and without their own letter background, so they could use the same reports for printing on pre-printed paper (no background), as well as send the PDF through email to their clients (with background). Read the rest of this entry »

NL Weerradar widget versie 2.4

December 30th, 2010

Een update van de NL Weerradar widget voor Mac OS X Dashboard, met daarin:

  • KNMI’s “Neerslagradar”
  • Buienradar’s “Sneeuwradar”!

Download versie 2.4!

Brandstofprijzen Widget 1.2

July 17th, 2010

Athlon (de gegevensbron van de widget) had de URL van de data gewijzigd, daarom een update naar versie 1.2.

Download de Brandstofprijzen widget en vergeet niet je commentaar achter te laten!

Brandstofprijzen widget update

November 19th, 2009

Zoals gemeld door Ko, had Athlon Car lease (waarvan de brandstofprijzen widget zijn gegevens betrekt) het adres van de brandstofprijzen pagina gewijzigd.

Daarom is de widget nu ge-update (naar versie 1.1), zodat deze weer werkt.

Download de Brandstofprijzen widget en vergeet niet je commentaar achter te laten!

NL Weerradar widget en Snow Leopard: hulp gevraagd!

August 25th, 2009

Gebruiker Dave meldt net dat de NL Weerradar widget niet goed werkt onder de nieuwste versie van Mac OS X, Snow Leopard.
Mocht je hetzelfde ondervinden en je kent de weg in Mac OS X, dan stel ik het zeer op prijs wanneer je de zeer waarschijnlijk aanwezige foutmelding in de Console, in de vorm van:
24-08-09 14:46:02 [0x0-0xc00c].com.apple.dock[257] Melding.....
hieronder in de comments zou kunnen plaatsen.

Zo kan er zo snel mogelijk weer gebruik worden gemaakt van de NL Weerradar widget onder Snow Leopard!

Nieuwe widget: Brandstofprijzen

June 5th, 2009

Het was weer tijd voor een nieuwe widget, ditmaal één gericht op de Nederlandse Mac gebruikers. Ik maak al een tijdje gebruik van de website van Athlon Car Lease, “Goedkoper Tanken”, waarvan de prijsgegevens volgens hen afkomstig zijn van de vloot leaserijders die met een tankpas tankt. Ik vind het in ieder geval de meest betrouwbare site m.b.t. de prijs van brandstofgegevens. Wat miste was een eenvoudige interface met link naar Google Maps.

Die is er nu voor Mac OS X Dashboard: de Brandstofprijzen Widget.
Brandstofprijzen Widget

Geef de postcode, de afstand en het brandstoftype op en de widget haalt de gegevens op en presenteert de resultaten overzichtelijk. Bladeren door de resultaten gaat d.m.v. de knopjes onderaan. Klikken op het adres opent de locatie op Google Maps. De resultaten zijn voorzien van de logo’s van de bekende tankstations.

De ingevoerde gegevens en de laatste zoekresultaten worden bewaard, zodat deze ook na een herstart van de computer of de widget direct beschikbaar zijn.

Downloaden van de widget en commentaar op de pagina van de Brandstofprijzen Widget!

Euro Stocks widget version 1.5

January 30th, 2009

After the appearance of some gibberish text on the widget, it was inevitably time to update. This is a minor update, just to get things going again.
In addition, user David B. mailed me in September already :S with a helpful addition: the ability to re-sort the stocks, using buttons on the back of the widget. This functionality is now included.

Download version 1.5 of the Euro Stocks widget.

For comments, please go to the Euro Stocks widget’s page!

Enjoy!

Note to users who update. Please write down the codes of your indices/stocks/funds before you update! Due to a design decision made earlier (to allow multiple instances of the widget, all with their own preferences) and the fact that Apple doesn’t provide a way to keep the unique widgetID between updates, the preferences of your widget won’t be retained between updates.