Blogs

NSIS - Finding ActiveX DLL registered path

I found myself working on another inherited application this week. As it with all inherited applications, especially ones as old as this one, the processes around deployment were a mess. In fact, most deployments had been done by hand with no standards around the deployment location. How was I supposed to write an upgrade for an application when I didn’t even know where it was installed?

At least the ActiveX DLL’s details were in the registry – retrieving them was a pretty simple two step process; you just need to know the name of one of the classes within your DLL.

NSIS - MSSQL_OLEDB: Running SQL script file with multiple commands

Many people have requested the ability to run an SQL file, which holds multiple commands.  As the developer states, this is not really possible as the plugin cannot really deal with multiple result sets and errors.

This would be extremely useful, especially when doing a fresh installation of an application.  All of my application installations install the databases from script, for a number of reasons:

  • Easier to do remote DB setup
  • Easier to keep code under version control

 

NSIS - .NET Framework version checking

I have recently become an avid fan of NSIS, the Nullsoft Installer Script. It is an extremely powerful way of creating installers, as it gives you control over almost every aspect the installer. Coming from a PHP/C#  background, I have also found it fun learning the quirky ways of using NSIS and am still not sure that I am doing things quite right.

Text File Splitter - C#.NET Custom Events

I recently received a a large text file (many megabytes) which was a concatenation of many different smaller files.  The smaller files where of different size and the separated by a particular character. I did a quick Google search, but almost all of the file splitting applications available split files based on size.

I needed to split a file based on a certain ASCII character.

Using CommandBuilder in a transaction (Copy data - part 2).

Once I got the initial data transfer up and running, I needed to place the whole thing into a transaction, I was doing multiple table transfers (with some data manipulation).  I could not have half a database transferred, even if I did throw an error.

I simply threw in an SqlTransaction, and made everything run inside that.

However, I hit an exception when using the SqlCommandBuilder to create the insert command:

Copying data from one database to another - Part 1

The task was straightforward, or so I thought; create a small application that transfers an applications configuration information from the test database into the production database

Debugging .NET COM DLL - within IDE

This may sound like a simple topic, however for someone who is quite new to .NET and used to Visual Studio 6 (VB6!!!) this was quite a difficult thing.

ASP.NET tips: Golden rules for Dynamic Controls.

1. Make sure your dynamic controls are Loaded on every postback.

Lets play with a very simple example,

ASPX

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

ASP.NET tips, Making Custom Validators work in Partial Rendering mode.

Introduction

There are many situations where we need to identify if partial rendering is supported in a page, especially when a control uses javascript, to get the control work in partial rendering mode, the script needs to be registered using a ScriptManager Type instead. A classic example will be Validators.

C# 3.0 tips, Automatic Property

Declaring a property in C# 3.0 is super easy and super short.

public class Student
{
  public string Name {  get; set; }
}

yes that's it, the framework will take care of the rest, the private variables will be automatically created and the getter and setter will be automatically implemented.

Here is how we can assign value to an automatic property via the constructor

public class Student
{
    public string Name {  get; set; }

Syndicate content