2011

You are browsing the site archives for 2011.

Previously I thought this was not possible, since the ASP.NET postback involves POST-ing the all-encompassing ASP.NET form, but I am here to tell you, that it is indeed possible to do a postback to a new window or even a popup (created with window.open). In fact, it is surprisingly simple. All you really have to know is that the “target” attribute you know from anchors (links) works exactly the same way for forms!
Continue reading ASP.NET Postback to new Window or Popup

I needed to grab a paged list of Data from some Website and wanted to do it with a Browser Automation Tool.

There’s Telerik’s Free Testing Framework but that one needs to be installed (because it uses Plugins/Addons for the Browser) in order to run.

I found a very nice alternative: WatiN (or http://sourceforge.net/projects/watin if the other page is down)
It’s a simple Library which allows everything needed when automating webbrowsers.

The Microsoft SQL Server Management Studio (even v2008 R2) has problems with executing large SQL-files. To execute these files you need to use the sqlcmd Utility.

Sample usage:

sqlcmd -S myServer\instanceName -i -U loginname -P password C:\myScript.sql

That one recently cost me a couple of hours and quite a bit of nerves to figure out: In a 64bit Windows, if a 32bit process accesses the Registry, it actually interacts with a DIFFERENT registry than a 64bit process. This means that your 32bit compiled program potentially reads and writes different registry keys than the same program compiled for 64bit! I’m sure you can imagine how this might result in seemingly strange behavior if you don’t know that. Windows Registry FTW, right?

Since regedit.exe runs as a 64bit process, you can usually only see the 64bit registry, but what if you want to see/change 32bit entries? It turns out you can do that if you know how this registry redirection works. In every node in the (64bit) registry there CAN be a child node with the name “WOW6432Node” that contains the 32bit entries that override/amend the 64bit entries. The only WOW node that I could find in my registry was in HKLM\SOFTWARE, but the concept works for every other part of the registry.

Source: http://msdn.microsoft.com/en-us/library/aa384253%28v=vs.85%29.aspx

Those of you familiar with Linux systems should know the very helpful “which” command which can tell you where exactly an executable that is in your PATH is located. The good news is, that a very similar command exists in PowerShell

> get-command tf

If the TFS exectuable is in your path, this gives you output of the form.

CommandType     Name                     Definition
-----------     ----                     ----------
Application     TF.exe                   C:\Program Files\Microsoft Visual Studio 9.0\Com...

But that’s not very helpful, is it? I mean, a quite important part of the path is cut off for crying out loud. So how do you get the FULL path?

> get-command tf | format-list

Name            : TF.exe
CommandType     : Application
Definition      : C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe
Extension       : .exe
Path            : C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe
...

And there you go. It’s a bit more complicated than necessary, but at least it’s possible.

I always forget how to Rollback a Changeset, so here’s the command to do it:

First, make sure you got the Team Foundation Server Power Tools installed.

Then execute the following command:

tfpt rollback /changeset:<changesetnumber> "<workspace>"

so for example:

tfpt rollback /changeset:48745 "C:\Workspaces\XXXComplete"