development blog for the wicked stuff we encounter

I got a backup of a database from a client, and I wanted to restore over a newly created database. When I selected the file, the Management Studio went berzerk: Cannot open backup device 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupbackup.bak'. Operating system error 5(error not found). RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201) This is a true WTF heart stopper, I thought that all the backups were invalid since we’re running the site :D Afterwards it turned out that the client backs up the database files to a networks share, so magically somehow the permissions has been altered for a local restore. According to this hint by Stevied, I added the Network Service user as an owner, and voila: all functionality magically returned… :)

I use Asp.Net DynamicData frequently, because it really speeds up development in a confortable way for some kind of projects. I'm using the DynamicData Futures July edition, and it has beautiful features like Ajax enabled DateTime UI, custom Where clauses, and Insert parameters etc. But it has some GUI design flaws: 1) the Child relations' text occupies way too much space, and makes it unreadable I've added some simple PNGs from the WebAppers Icon Set to make it more vivid for the end user. Download the icon set, and select the icons you like. The template files can be found under ~/DynamicData/FieldTemplates/ The Child relations file is named Children.aspx,  the codebehind file is Children.aspx.cs. In the Page_Load event of the codebehind, i simply commented out the name setting of the child table, because it's already in the Table header:
        protected void Page_Load(object sender, EventArgs e) {
            //HyperLink1.Text = "View " +ChildrenColumn.ChildTable.GetDisplayName();
            //InsertHyperLink.Text = "Insert " +ChildrenColumn.ChildTable.GetDisplayName();
and in the aspx file, I've added the icons, and removed the two objects referred in the aspx.cs:


Back in the codebehind file, you need to replace the reference to HyperLink1 to InsertLink:
        public override Control DataControl {
            get {
                //return HyperLink1;
                return InsertLink;
Build, and see in action: dinamicdatawithicons1 You can do it with ForeignKeys as well - I choose the Next type icon for the outer reference. 2) the GridView controls are missing the GridViewAlternateRows settings Simply do a text search for "asp:GridView", and add AlternatingRowStyle-CssClass="even" to every occurence. If you finished, create a new CSS class in ~/Site.css:
.even {
    background-color:#eeeeee !important;
    background: #eeeeee  !important;
This will work in every major browsers :)

When rolling out ChromeMailer to the people on the wild internets, some reported problems with missing mailto: handlers in registry. If ChromeMailer redirected you here, please see the steps below to repair your mailto handlers.  NOTE: YOU ARE RESPONSIBLE FOR THE CHANGES YOU MAKE IN YOUR REGISTRY! There's two ways to fix the issue:  1) Download fix_mailto.reg , (right click -> save as...) then double click it to install. It will recreate all required nodes. 2) Manually. Open Regedit (Start / Run... or in Vista type Regedit into search) click on HKEY_CLASSES_ROOT. right click on it, New > key, rename it to "mailto", then select mailto, New > key, create "shell", in shell, create "open", in open create "command", in command: New > string value .it will create a key named (Default), double click on the (Default), and enter the following: a) on Vista: C:Program FilesWindows MailWinMail.exe /mailurl:%1 b) on XP: C:Program FilesOutlook Expressmsimn.exe /mailurl:%1 This will reset the mailto: protocol handler to Windows default settings. If you now want to use ChromeMailer, simply run it, press 'Install as Default Mailer' and it will work as expected.


Installing Chromemailer does NOT mean you've set it up! Please go to Start menu -> Programs -> ChromeMailer and run ChromeMailer.exe!

You can always find the executable under (your install drive, usually C:) Program FilesSkaelede OnlineChromeMailerChromeMailer.exe

People keep asking me, why do they need to use ChromeMailer, how it differs from the good old registry hacks? Here's the technical information: ChromeMailer modifies the default mailto: handler in the registry (HKEY_CLASSES_ROOT || HKEY_CURRENT_USER mailtoshellopencommand), as the good old registry hacks do. If a computer is a stand-alone one, it will use the HKEY_CLASSES_ROOT,if it's in a domain it will use HKEY_CURRENT_USER. (others' settings will not be affected - only if the user is logged in as a Domain Administrator.) The true difference between the other registry-hacks and ChromeMailer is, that it sets the handler to itself, and rewrites the mailto: parameters. A valid mailto: is like: If you pass Gmail URL + mailto: params directly to Chrome (or any other browser) in the registry, with %1 parameter, it will truncate some parts of it, because 2 question marks will be in the URL, and it's not permitted without UrlEncode: so anything after the second will miss. For example: would show up a window with the to address filled, but subject missing. Parameter rewrite is the reason for UAC error on Vista, i don't have $399 to to buy code authentication for my *free* app. So for a user request, in version 0.2 I added the possibility to use this "truncated" mode, so it will not show up any messages, and will work in 80%... :)