Featured Post

Organize and rename photos by EXIF data with PowerShell

This PowerShell script organizes and renames all photos in a selected folder using EXIF data. It will also create thumbnails of the images i...

Thursday, March 13, 2014

Row not found or changed... meet ChangeConflictException handler!

Row not found or changed exceptions are frustrating... until now!

catch (ChangeConflictException cce)
{
    // Where DB is your database context
    foreach (ObjectChangeConflict occ in DB.ChangeConflicts)
    {
        MetaTable metatable = DB.Mapping.GetTable(occ.Object.GetType());
        Debug.WriteLine("\nTable name: " + metatable.TableName);
        foreach (MemberChangeConflict mcc in occ.MemberConflicts)
        {
            Debug.WriteLine("Member: " + mcc.Member);
            Debug.WriteLine("\tCurrent  value: " + mcc.CurrentValue);
            Debug.WriteLine("\tOriginal value: " + mcc.OriginalValue);
            Debug.WriteLine("\tDatabase value: " + mcc.DatabaseValue);
        }
    }
    throw;
}

Thursday, January 16, 2014

How to format USB device with FAT32 on Windows 7

Find the Drive Letter of the device you wish to format. In this example I am formatting the F: drive.

Open Command Prompt

Use the format command:

Note: This will erase all data on the drive letter you specify, be sure you are choosing the correct letter...

format F: /V:PEN /Q /FS:FAT32