"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Tuesday, May 10, 2011

HttpApplication Instances

During the lifetime of your application, ASP.NET maintains a pool of Global.asax-derived HttpApplication instances.When your application receives an HTTP request, the ASP.NET page framework assigns one of these instances to process that request. That particular HttpApplication instance is responsible for managing the entire lifetime of the request it is assigned to, and the instance can only be reused after the request has been completed.

 Hope u got it...
Stay tune...
Have a nice day... 'N happy Coding :)

Friday, May 6, 2011

Getting File type or Getting file extension

 Getting File type or Getting file extension is done by some many ways a few is listed here ::-
  • string fileExtension = System.IO.Path.GetExtension(@"C:\MyFolder\MyFile.jpg"
  • System.IO.FileInfo f = new System.IO.FileInfo(Server.MapPath("~/MyFolder/MyFile.jpg"));
    string extension = f.Extension;
 Over here i prefer the second method.

Stay tune...
Have a nice day... 'N happy Coding :)

Tuesday, May 3, 2011

Choosing between char, varchar, varchar(MAX) and text datatype in SQL Server 2005

char, varchar, varchar(MAX) and text datatype are used for storing character string. Note you cannot store multilingual data. i.e. You will not allowed to store japanes or hindi characters.

Char datatype
  1.  Stores character (non-unicode) data.
  2.  Stores data in fixed-length format.  
  3.  Choose char datatype when size of data is consistent.
Varchar datatype

  1. Stores Character (non-unicode) data.
  2. Stores data in variable-length format.
  3. Choose varchar datatype when size of data varies between 8000 bytes

Varchar(MAX) datatype
  1. Stores Character (non-unicode) data.
  2. Stores data in variable-length format.
  3. Choose varchar datatype when size of data varies and it may exceeds 8000 bytes.

Text datatype

  1. Text datatype is used in previous versions of SQL Server, it is recommended to use Varchar(MAX) instead of Text datatype, as ntext, text, and image data types will be removed in a future version of Microsoft SQL Server
  2. Stores large amount of character string
  3. Stores data in variable-length format.
  4. Choose text datatype when size of data varies may exceeds 8000 bytes.



Have a nice day... 'N happy Coding :)