Capturing the Deleted Text in TextBox when Backspace or Delete Key is Pressed

If you have ever wanted to get the deleted character/text from a textbox when the Backspace key or the Delete key on the keyboard is pressed, you would know that there is no easy way to do that. You can easily get the typed text (using any of the keyboard events like KeyDown, KeyPress etc.), but not the deleted text.

However it is not impossible to achieve this. All you need is some event/method that executes before the KeyDown event is fired. And fortunately there are many.

For this demo I will show you how to do that using the ProcessKeyMessage , but you can use any of the others as well (e.g. WndProc etc.) … Read the full article »

Connecting Windows 7 Workgroup to Windows 2008 Server

We recently upgraded our machines. The old ones were Windows XP running on 32-bit dual core processors. The new ones are with Core-i7 processors and had Windows 7 Professional (64 bit) preinstalled.

In our existing setup, we have one windows 2008 machine and many windows XP machines.  The PCs are connected in a Workgroup, and the server is used mainly as a DHCP server, internet access and for common file sharing. There were no issues till now accessing the Windows 2008 Server from the existing Windows XP machines.

Now, in the new Windows 7 machines we found a peculiar problem. Everything worked as expected, except that we are not able to access the shared folders on windows 2008 server … Read the full article »

Executing a set of SQL Script Files (*.sql) on a Group of SQL Server Databases

This post is a continuation of my pervious articles:

In the last part, I showed how to extract attachments from the emails. In this part, we will see how to execute them in a batch on a number of SQL Server databases. … Read the full article »

Extracting Attachments from Selected Emails

This is a continuation of the article “Automating the Process of Extracting *.sql Attachments from Emails and Executing them on a set of SQL Server Databases”. If you have not read that article, I recommend you do that before proceeding further.

The Problem

Find a way to extract all attachments from selected emails into a selected folder on hard-drive.

The Solution

  1. Open Microsoft Outlook.
  2. Click Tools > Macro > Visual Basic Editor (or press Alt+F11) to open the VBA Editor. … Read the full article »

Automating the Process of Extracting *.sql Attachments from Emails and Executing them on a set of SQL Server Databases

Recently I was off on a long leave from my work. After returning to office, I found that there are so many emails accumulated in my inbox, and many of them contained SQL script files to be executed on my local SQL Server test databases. Extracting each file into a folder and then executing each of these files (*.sql files) on each database was just like the task I always hate. There were some hundred of these attachments, and each file had to be executed on about 6 databases. So if I do everything manually, it will take me days to finish this.

So I set off for making a script that will automate this. … Read the full article »