A colleague wanted to do a database query from a computer without any database client. He needed a tool that allowed him to type in a SQL query, and receive a sortable grid with the result set. All of these features are built-in in the .NET Framework, and it didn’t take me more than 2 minutes to do an exe file with these features using Visual Studio 2010. I used .NET 2.0 because these basic features are available in that version, and he did not want to install a newer version of the .NET Framework. This is the user interface: A tab strip with three tabs. One for a connection string, one for the query and one for the result[…]

If you want to call a static function (Shared in Visual Basic) in the .NET Framework, you type in the full name of the class (including the namespaces) followed by double colon (::) and the name of the function you want to call. The function Load in the Assembly class can be used to load .NET assemblys from the GAC, so if you want to use the .NET Framework, it’s a good start to load the parts of the .NET Framework you need. [System.Reflection.Assembly]::Load(“System.Windows.Forms, Version=2.0.50727.1433, Culture=neutral, PublicKeyToken=b77a5c561934e089”) Notice that the string argument that is passed to the Load function is fairly complex. There is a chicken version of Load available where you only have to specify the path to the namespace you want to[…]