Fired Over Personal E-Mail

So I recently read a headline and article (http://brntpb.st/zVainJ) that made me laugh.  On the one hand I applaud any worker, in this case government researchers and scientists, who file complaints on organizations, both public and private, for doing things they shouldn’t be.  However there is a simple rule in any business:

Do Not Use Your Work Computer For Personal Activities!

All large organizations either monitor activity because they can or because they are required to by law for legal reasons.  If you want to use your personal e-mail at work just be aware that they most likely can read everything you send let alone take screenshots of your computer periodically as well.  There is no assumption of privacy on the computers or networks of your workplace… ever!

Use your smartphone on the PUBLIC 3G or 4G signal if you really want privacy as even company provided Wi-Fi access can be monitored as if it were your own computer.  I’m not saying the FDA was in the right here, but regardless as sensible professionals please remember your work computer is for work, and not personal activity.  You never know who is watching.

-Brent

Checking Luggage When Traveling

Many business travelers will tell you never to check a bag.  This is typically a true concept for simple trips or very short trips.  But this is typically only true for domestic flights.  It's simply too much work when traveling internationally to worry about bags.  After all you only get one carry on and a personal item.  For my female friends this means a backpack and a purse and that's it!

If you do travel internationally just a little bit of wisdom, especially if you are using different airlines throughout your trip:

- Make sure so hold on to your bag check tag.

This is the little receipt looking paper that you will get from the gate agent when you check your bag.  Make sure to hold on to this receipt, if you lose it they may not be able to find your bag when you make another connection.

Either way, hold on to that tag and don't be too afraid to check, on longer flights it is totally worth the worry-free experience.

Safe travels!

-Brent

Send Files via Skype using Windows Context Menu

So I was going to use the normal route of sending a file to a colleague today.  Normally I either attach a file to an Outlook E-Mail or use the Windows context menu (Right-Click) to send the file as an e-mail attachment.  I went with the context menu route today and found a feature I am not used to seeing… Skype!

Image001

Needless to say my colleague was also on Skype.  Once I clicked on the Skype option it opened the normal Skype window where I could select the contact to send the file to.

Image002

Once I selected the contact it sent a normal File Transfer Request via Skype to my contact.

Pretty easy, and cool!

-Brent

Using DateTime2 with Entity Framework

A common problem posted all over the web is in regards to DateTime2 errors thrown by Entity Framework.  Those problems are typically associated with the system generating invalid column and data types that are not supported by the older versions of MSSQL.  Fixing those problems is typically pretty easy and requires an update to the EDMX XML to specify the right database version to target.

My issue however is that I actually want to use DateTime2 as the column data type.  There are many reasons why you may want to do this and the benefits outweigh any risks associated with it.  The problem is however that there is no DateTime2 data type in .NET, only DateTime so when the T-SQL code is generated for the database (in model first mode) it will utilize the default DateTime column type and not DateTime2.

The solution below will change all DateTime data types in your model to utilize DateTime2 SQL storage types.  You cannot pick and choose easily which tables should use DateTime2 versus the default DateTime.  The entire solution is based around modifying the default T4 template for your project.

  1. Browse to: %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen
  2. Copy the SSDLToSQL10.tt file to your project directory
  3. Browse to %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes
  4. Copy the GenerateTSQL.Utility.ttinclude file to your project directory.

Note: I like to keep my template files in a different folder from my models and a sub-directory in the templates folder to store the include files.

  1. Edit the SSDLToSQL10.tt file
  2. Update the T4 file with the following code: http://codepaste.net/rchy2s
  3. Change the template filename in the EDMX Designer:

1-2-2012_2-07-17_pm

Now all you have to do is re-generate the model and the DateTime2 type should be used.

-Brent