Tuesday, October 1, 2013

Why unknown file types are not served by IIS

Here is the command:
%windir%\system32\inetsrv\appcmd set config /section:staticContent /+"[fileExtension='.3gp',mimeType='video/3gpp']"
And while we are at it. You might run into the same problem with MP4 files. Here is the appcmd for it:
%windir%\system32\inetsrv\appcmd set config /section:staticContent /+"[fileExtension='.mp4',mimeType='video/mpeg']"

Get Week Day No and Name in Crystal Report

First Get WeekDay No using this function

WeekDay ({DateGoesHere}, firstDayOfWeek) 
date(DateTime): Any valid date, 
firstDayOfWeek(int): Possible Values[crMonday, crTuesday, crWednesday, crThursday, crFirday, crSaturday, crSunday]: Default crSunday
Then use
WeekDayName(WeekDay ({DateGoesHere}, firstDayOfWeek), false, firstDayOfWeek)

Monday, September 30, 2013

Adding a column to all user tables in ms sql server

There is an undocumented but well known stored procedure sp_msforeachtable:
exec sp_msforeachtable 'alter table ? add {colname} {dataType} {null|not null} ....';

Friday, September 27, 2013

Remove totals from crystal report cross tab

In the top-left corner of the Cross-Tab there is a blank cell - right click inside that cell and select Cross-Tab Expert from the shortcut menu.


On the third tab, Customize Style, there are check boxes where you can suppress subtotals and grand totals.

Variable persistence on postback asp net

An ASP.NET page class file is destroyed after it is served to the client. The most chosen method for preserving variables in ASP.NET from one page load to the next is to store them in
  • ViewState
    • Small data for current page only
  • Session
    • Small or large data for across the web site or app
  • Hidden Input 
    • Small data for current page only
  • Cookies
    • Small data for long time across the website or app
  • Cache 
    • Small or large data for across the website or app