avatar

Andres Jaimes

Exchange: The database files in this storage are inconsistent

This morning I got a new surprise from my Exchange server. Outlook clients could not connect to the servers, however the server seemed to be working pretty normal. After some research I found out the Exchange databases were corrupted. But, how did this happen? Well, they can get corrupted when Windows is not shutdown in a proper way, or a service or process misbehavior leaves them in an inconsistent state or when there are physical errors on your hard disk.

How I made my HP LaserJet P1102w work with my iPad

I got an HP LaserJet P1102w about a year ago, so long before I thought I was going to get an Apple’s iOS device. I purchased it just because I thought it would be useful to have a printer that could work wirelessly. At that time I made it work using wireless, but for some reason it stopped working. I didn’t care because it was very simple to connect it via USB to my computer and get my stuff done.

Old school: Use xcopy to back up your stuff

Need an easy way to back up your files, but don’t feel like monkeying with expensive or complicated software? Using the xcopy command and a simple text file, you can accomplish this rather easily. Here’s what I do. First, make sure that file extensions are not hidden by going to My Computer > Tools > Folder Options > View. Uncheck Hide Extensions for Known File Types and click OK (if it’s already unchecked, don’t worry about it).

How to create a simple gradient in C#

Creating a simple gradient using two colors is very simple: Rectangle rect = new Rectangle(0, 0, 100, 100); LinearGradientBrush lgb = new LinearGradientBrush(rect, Color.White, Color.Blue, 90); e.Graphics.FillRectangle(lgb, rect); This code will generate a gradient in the given rectangle that goes from white to blue in a vertical way (see last parameter in constructor). In this case, e, is any class that encapsulates the System.Drawing.Graphics class. Once the gradient is ready, well, you have to actually draw it by calling the FillRectangle function.

Printing in C# – The easy way

Believe me, it is easy. As with any class, before we can use any of the Classes, Events and Objects available to us in the .Net Framework we need to import the Namespaces we need. For this we need 3 namespaces. VB.Net users only required 2 because VB.Net assumes the System Namespace, whereas C# isn’t so kind: System System.Drawing System.Drawing.Printing These 3 Namespaces contain everything we need for this class, so you will need to add the following lines to the top of your class file:

How to choose a printer using C#

You can assign a printer and other settings by using the basic PrintDocument and PrintDialog controls properties. Look at the next example: if (printDialog.ShowDialog() == DialogResult.OK) { printDocument.PrinterSettings.PrinterName = printDialog.PrinterSettings.PrinterName; printDocument.PrinterSettings.Copies = printDialog.PrinterSettings.Copies; }

IIS tips and tricks

Running multiple versions of the .NET framework in IIS When you install a new .NET framework in your IIS server some applications can stop working showing you the following error: Server Application Unavailable In the event viewer you will find this: the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process. This happens because different .NET frameworks can run in the same server, but cannot share the same application pool, so, to solve this: