Sunday, July 18, 2010

DateTime MinValue in SQL SERVER and C#

I was trying to store C# DateTime.MinValue in SQL SERVER and got the following exception

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

In SQL Server the minimum date that can be stored in a datetime field (1753/1/1), is not equal to the MinValue of the DateTime .NET data type (0001/1/1).

Therefore if your datetime value is DateTime.MinValue then don't save it in SQL SERVER.

Tuesday, July 13, 2010

IIS6 Meta bas compatibility in IIS7.5 and windows 7

IIS7 has done away with the metabase, but some pre-IIS 7 applications rely on the metabase as part of their installation process. This is a Windows feature that you can turn on and off throught the control panel.

Note: This is not a separate install.


Monday, July 05, 2010

IIS 7.5 and Windows 7

HTTP Error 500.19 - Internal Server Error

This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

Solution

The applicationHost.config had the handler section locked:

Changed


to


and it fixed the issue.

System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session.

I got this error when using Entity Framework with the following code.


Solution

The foreach loops were the culprits. I needed to call EF but return it into an IList of that target type then loop on the IList.

Yahoo Style Guide

The style guide for the Internet age

Anyone can publish on the Web, but not everyone is publishing material that's ideal for online reading. Enter "The Yahoo! Style Guide," your guide to writing and editing for the Web. People read online text differently, and they have different expectations when they read it -- most notably, they expect instant gratification, the ability to find what they want on a webpage fast

The Yahoo! Style Guide: The Ultimate Sourcebook for Writing, Editing, and Creating Content for the Digital World" will be in stores from July 6

Check the site for more information.