Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Monday, June 20, 2011

How many web.config files for sngle application?

How many web.config files for sngle application?

You should have only one web.config. 
but in sub folder you can have one web.cofing to set configuration of that folders.

 Example
 if your application have 4 folder then 5 web.config have in your application

Configuration File Dotnet

What is Web.Config File?

It is an optional XML File which stores configuration details for a specific asp.net web application. 



What is Machine.config File?

The Machine.Config file, which specifies the settings that are global to a particular machine. This file is located at the following path:

 

\WINNT\Microsoft.NET\Framework\[Framework Version]\CONFIG\machine.config

 

   As web.config file is used to configure one asp .net web application, same way Machine.config file is used to configure the application according to a particular machine. That is, configuration done in machine.config file is affected on any application that runs on a particular machine. Usually, this file is not altered and only web.config is used which configuring applications.

 

You can override settings in the Machine.Config file for all the applications in a particular Web site by placing a Web.Config file in the root directory of the Web site as follows:

\InetPub\wwwroot\Web.Config

Macine Config VS WebConfiguration

Difference between Machine.Config and Web.Config
Machine.Config:
i)  This is automatically installed when you install Visual Studio. Net.
ii) This is also called machine level configuration file.
iii)Only one machine.config file exists on a server.
iv) This file is at the highest level in the configuration hierarchy.

Web.Config:
i)  This is automatically created when you create an ASP.Net web application project.
ii) This is also called application level configuration file.
iii)This file inherits setting from the machine.config

Monday, June 13, 2011

Collection -2D Array

2 D Array
You want to use a 2D array containing any type(int,string ,etc) of value in your C# program
2D array contain 2 pair of values
Performance  PERF
2D Array  are slower to index elements than 1D arrays. They are sometimes more memory
2D Array String
String[,] os=new string[,]{
{"dev","Svalue"},
{"devenvexe","JValue"}
};
2D Array Int:
int[,] os=new int[,]{  {1,2}, {3,4} };
Get the Upperbound to Loop:
        

 string[,] ad = new string[,]
       {
           {"dev", "devenvexe"},
           {"TCS", "Tata"},
           {"CTS", "Cogn"},
          
       };

            // Get the upper bound to loop.
            //Upper bound means specify the dimention (0 or 1)
            for (int i = 0; i <= ad.GetUpperBound(0); i++)
            {
                string FDim = ad[i, 0]; // JS, TCS, CTS...
                string SDim = ad[i, 1]; // J Suqare, Tata, Cogn...

                MessageBox.Show(FDim);
                MessageBox.Show(SDim);
            }
If you want use Length keyword .it will return 6 so
string[,] ad = new string[,]
       {
           {"dev", "devenvexe"},
           {"TCS", "Tata"},
           {"CTS", "Cogn"},
          
       };

            // Get the upper bound to loop.
            //Upper bound means specify the dimention (0 or 1)
            for (int i = 0; i <= ad.Length/2; i++)
            {
                string FDim = ad[i, 0]; // JS, TCS, CTS...
                string SDim = ad[i, 1]; // J Suqare, Tata, Cogn...

                MessageBox.Show(FDim);
                MessageBox.Show(SDim);
            }
GetUpperBound VS Length:
Its faster to use Array Length
Looping Speed:
GetUpperBound: 142 ms
Length/2     : 47 ms

Wednesday, June 8, 2011

Collection - Array

Array
Arrays are references that point to fixed sizes of memory that you can store different kinds of elements in, such as values or references to other objects. In these examples, we look at simple examples of arrays.

·       Arrays is fixed number of memory allocate in system
·       It is initialize and with accessing with Square brackets []
·       Two dimensional array use comma with in bracket
How to create Array:   
 Int[] value=new int[Length]
// Int means data type suppose if you want string,bool,etc…
// value  is data type
// length means ,you can enter int value
Ex:
String val=new String[3];
Ex Program:
Using system;
Class Progra
{
//Public void button Click
Sting val=new String[3];
Val[0]="devenvexe";
Val[1]="Suthahar";
Val[2]="Suresh";
Foreach(string n in Val)
{
MesageBox.Show(n.Tostring);
}
}

Tuesday, May 3, 2011

How to use C# string Format

How to use C# string Format

string Format method replace the argument Object into a text equivalent System.String.

Replace string Particular index   for ex System.String.Format("Hi welcome Mr {0}","Sutahahr")

System.String.format(string format,Object arg0)

Parameters:

String format : The format String

The format String Syntax is like {indexNumber:formatCharacter}

Object arg0 : The object to be formatted.

Returns:

String : The formatted String


Examples :

Currency :

String.Format("{0:c}", 10) will return $10.00

The currency symbol ($) displayed depends on the global locale settings.

Date :

String.Format("Today's date is {0:D}", DateTime.Now)

You will get Today's date like : 01 January 2005

Time :

String.Format("The current time is {0:T}", DateTime.Now)

You will get Current Time Like : 10:10:12


--
J.SuThahar MCA 
MicroSoft Technology Specialist
Microsoft Certified ProfessionalDeveloper
www.jsuthahar.tk
09943151415


Tuesday, April 19, 2011

Debug Program avoid Attach Process-c#.net Tips

 
 
If you  need to debug an application in a point where it's difficult to attach debugger manually
 
You can use following code  anywhere in your application
 
System.Diagnostics.Debugger.Break();
 
or
 
#Region
 
System.Diagnostics.Debugger.Break();
 
#Endregion
 
 


--
J.SuThahar MCA 
MicroSoft Technology Specialist
Microsoft Certified ProfessionalDeveloper
www.jsuthahar.tk
09943151415


Tuesday, February 22, 2011

Types of JIT Compilers

When the program is executed the CLR activates JIT compiler ,inturn this JIT converts the MSIL Code (Non Executable) to Native Code(Executable) on demand basis as each part of Program is needed

Types Of JIT Compilers are as stated below :
(1) PRE JIT

(2) ECONO JIT

(3) NORMALE JIT


(1) PRE JIT : It Compiles complete source code to native caode In a single Compilation.

(2) ECONO JIT : It compiles only those methods that are called at Runtime.

(3) NORMALE JIT : It compiles only those methods that are called at Runtime and are stored in cache.When these methods called again they retrieve from cache.

Default  JIt is PRE Jit .