Thursday, September 24, 2009

OledbException: " Data type mismatch in criteria expression"

This exception happens today when I have columns with characters "." (Dot) or "-" (Hyphen).

Try to avoid this if possible.

Monday, September 14, 2009

Select 30% of records randomly in SQL Server

select top 30 percent * from [table_name] ORDER BY NEWID()

select 30% of records of last month

select top 30 percent * from[table_name]
and DatePart(""m"", date_created) = DatePart(""m"", DateAdd(""m"", -1, getdate()))
AND DatePart(""yyyy"", date_created) = DatePart(""yyyy"", DateAdd(""m"", -1, getdate()))
ORDER BY NEWID()

Sunday, September 13, 2009

HttpContext.Current.Cache.Insert

HttpContext.Current.Cache.Insert

this.Page.ClientScript.RegisterClientScriptBlock