Wednesday, 5 November 2014

MVC Routing Concept

URL stand for Uniform Resource Locator
for example www.abc.com/directory/emplyee.htm

URI is an identifier for some resource, but a URL gives you specific information as to obtain that resource.URL doesn’t necessarily mean a physical location of a static file on a web server’s
hard drive somewhere ,it means some unique identifier.

Most of the cases Webserver  and then directory and sub directory and file name

But in MVC the method is different
  1. MVC matches controller action rather than file system
  2. MVC also matches outgoing request with  controller action rather than file system

Route definitions start with the URL pattern, which specifies the pattern that the route will match. Along with the route URL, routes can also specify default values and constraints for the various parts of the URL, providing tight control over how and when the route matches incoming request URLs


Application_Start()   method contains a call to a method named the
RegisterRoutes method


 public static void  RegisterRoutes (  RouteCollection routes  )
{
      routes.MapRoute( “example”, “{first}/{second}/{third}”);
}

Routing: /albums /display/123
Result: first = “albums” second = “display” third = “123”
routes.MapRoute(“simple”, “{first}/{second}/{third}”);

The {action} parameter value is used to indicate which method of the controller to call in order
to handle the current request. Note that this method invocation applies only to controller classes
that inherit from the System.Web.Mvc.Controller base class. Classes that directly implement
IController can implement their own conventions for handling mapping code to handle the
request.

Any route parameters other than {controller} and {action} can be passed as parameters to the
action method, if they exist. For example, assuming the following controller:

public class AlbumsController : Controller
{
            public ActionResult Display(int id)
           {
                return View();
            }
}

ROUTE URL PATTERN                           EXAMPLES OF URLS THAT MATCH
{controller}/{action}/{genre}                      /albums/list/rock
service/{action}-{format}                            /service/display-xml
{report}/{year}/{month}                              /{day} /sales/2008/1/23

routes.MapRoute(“simple”, “{controller}/{action}/{id}”,new {id = UrlParameter.Optional});


Multiple default values can be provided. The following snippet demonstrates providing a default
value for the {action} parameter as well:
routes.MapRoute(“simple”, “{controller}/{action}/{id}”, new {id = UrlParameter.Optional, action=”index”});

using System.Web.Routing;

Monday, 3 November 2014

SQL Server 2012 Magic

1)Unusual Sort Orders
         (Order by Contain Case)

SELECT  certificate_id,
                certificate_name,
                certificate_code,
                type_id,
               date_position
                              FROM tbl_sref_train_certificate
                             ORDER BY
                                     CASE
date_position WHEN NULL
                                        THEN type_id
                                   ELSE  date_position  END

2) NULLIF,COALESCE

ISNULL : Returns a null value if the two specified expressions are equal.

SELECT NULLIF(2,2)

Result
----------------------------------------
 NULL

SELECT NULLIF(2,3) 
Result
----------------------------------------
2

COALESCE : coalesce returns the first non-null expression among its arguments.

Example 1
SELECT COALESCE(NULL, NULL, NULL, GETDATE()) 

Result
----------------------------------------
2014-11-02 22:48:40.780

The above example may have single value or four values. If it has single value, then it fills null values with remaining attributes.

---------------------------------------------------------------
column 1              |     column1
----------------------------------------------------------------
 Abc                          NULL
NULL                      Efg
--------------------------------------------------------------

Example 2
 SELECT COALESCE(column 1, column1 )

Result
----------------------------------------
  Abc
 Efg

Example 3
Concatination

---------------------------------------------------------------
Country              |     Currency
----------------------------------------------------------------
India                          Rupee
Japan                         Yen
--------------------------------------------------------------


SELECT  Country ,
                 Currency,
                 COALESCE(Country,Currency)  As Country_Currency

---------------------------------------------------------------
Country              |     Currency     | Country_Currency
----------------------------------------------------------------
India                          Rupee           India Rupee          
Japan                         Yen               Japan Yen                              
--------------------------------------------------------------

3) UNION AND UNION Goof Exapmle

DECLARE @test1 TABLE
(
  ID INT,
  NAME VARCHAR(200)
)
DECLARE @test2 TABLE
(
  ID INT,
  NAME VARCHAR(200)
)

INSERT INTO @test1 VALUES (1,NULL),(2,'India'),(3,'Japan'),(4,NULL)
INSERT INTO @test1 VALUES (1,NULL),(2,'USA'),(3,'Braziln'),(4,NULL),(1,'India')

SELECT ID,NAME FROM @test1
UNION
SELECT ID,NAME FROM @test2

SELECT ID,NAME FROM @test1
UNION ALL
SELECT ID,NAME FROM @test2

Result
----------------------------------------
ID NAME
-----------------------------------------
1    NULL
1    India
2    India
2    USA
3    Braziln
3    Japan
4    NULL

Result
----------------------------------------
ID NAME
-----------------------------------------
1    NULL
2    India
3    Japan
4    NULL
1    NULL
2    USA
3    Braziln
4    NULL
1    India

4)Random Rows Return

SELECT  member_id,
        last_name,
        first_name
 FROM tbl_member
 TABLESAMPLE SYSTEM (1 PERCENT);

Result (1st Execution)
----------------------------------------
102  rows

Result (2st Execution)
----------------------------------------
106  rows

So on...

5)Overriding an IDENTITY Column

CREATE TABLE TEST
(
    ID INT IDENTITY  ,
    COUNTRY VARCHAR(200)
)

INSERT INTO TEST (COUNTRY) VALUES ('India'),('Brazil'),('China')

SELECT * FROM TEST

Result
----------------------------------------
ID NAME
-----------------------------------------
1    India
2    Brazil
3    China



SET IDENTITY_INSERT [Database].TEST
INSERT INTO TEST (COUNTRY) VALUES (4,'Pakistan'),(5,'Irac')


----------------------------------------
ID NAME
-----------------------------------------
1    India
2    Brazil
3    China
4   Pakistan
5   Irac


6) Deleting Rows and Returning the Deleted Rows

CREATE TABLE TEST
(
    ID INT IDENTITY  ,
    COUNTRY VARCHAR(200)
)

INSERT INTO TEST (COUNTRY) VALUES  ( 'India' ),( 'Brazil'  ),(  'China'  ),(  'Nepal'  )

DELETE
FROM TEST
OUTPUT deleted.COUNTRY
WHERE ID=4

7) Inserting Rows and Returning the Inserted Rows

CREATE TABLE TEST
(
    ID INT  ,
    COUNTRY VARCHAR(200)
)

INSERT INTO TEST (ID,COUNTRY)
OUTPUT INSERTED.COUNTRY,INSERTED.ID
VALUES       (1,'India')  ,  (2,'Brazil')  ,  (3,'China')  ,  (4,'Nepal')

8)Updating Data and Returning the Affected Rows

CREATE TABLE TEST
(
    ID INT  ,
    COUNTRY VARCHAR(200)
)

INSERT INTO TEST (ID,COUNTRY)
VALUES (1,'India') , (2,'Brazil') , (3,'China') , (4,'Nepal')


CREATE TABLE TEST1
(
    ID INT  ,
    COUNTRYX VARCHAR(200) NULL
)

INSERT INTO TEST1
VALUES (1,NULL),(2,NULL),(3,NULL),(4,NULL)

SELECT * FROM TEST1

UPDATE A
           SET A.COUNTRYX=B.COUNTRY
           OUTPUT INSERTED.COUNTRYX
FROM  TEST1 A
INNER JOIN TEST B
ON A.ID=B.ID

SELECT * FROM TEST1


9) SoundIndex ...Sound Like

DROP TABLE TEST

CREATE TABLE TEST
(
    ID INT  ,
    COUNTRY VARCHAR(200)
)

INSERT INTO TEST (ID,COUNTRY)
VALUES (1,'India'   )  ,
                (2,'Brazil'  )  ,
                (3,'China'  )  ,
                (4,'Nepal'  )  ,
                (5,'ian'      )  ,
                (6,'en'       )  ,
                (7,'an'       )  ,
                (8,'am'      ) ,
                (9,'em'      ),
                (10,'am'    )



SELECT  top 5 COUNTRY
FROM TEST
WHERE  SOUNDEX(COUNTRY)=SOUNDEX('inI')

Result
----------------------------------------
COUNTRY
-----------------------------------------
ian


10) Merger Statement

CREATE TABLE TEST
(
    ID INT  ,
    COUNTRY VARCHAR(200)
)

INSERT INTO TEST (ID,COUNTRY)
VALUES    (1,'India'),
                   (2,'Brazil'),
                   (3,'China'),
                   (4,'Nepal'),
                   (5,'ian'),
                   (6,'en'),
                   (7,'an'),
                   (8,'am'),
                   (9,'em'),
                   (10,'am')


CREATE TABLE TEST1
(
    ID INT  ,
    COUNTRYX VARCHAR(200) NULL
)


MERGE INTO TEST1 AS C
USING TEST AS CT
        ON C.ID = CT.ID
WHEN MATCHED THEN
    UPDATE SET
      C.COUNTRYX = CT.COUNTRY    
WHEN NOT MATCHED THEN
      INSERT (ID,COUNTRYX)
      VALUES (CT.ID, CT.COUNTRY);
     
SELECT * FROM TEST1

---------------------------------------------------------------------------------
ID COUNTRYX
----------------------------------------------------------------------------------
1    India
2    Brazil
3    China
4    Nepal
5    ian
6    en
7    an
8    am
9    em
9    am

11) Sring Operation 

LEFT & RIGHT

SELECT LEFT  (  'India Govt has started clean india mission.' , 10)
SELECT RIGHT ( 'India Govt has started clean india mission.' , 10) ;

Result
----------------------------------------
(No column name)
-----------------------------------------
 India Govt


Result
----------------------------------------
(No column name)
-----------------------------------------
a mission.


UPPER & LOWER 

SELECT UPPER ( 'India Govt has started clean india mission. '  )
SELECT LOWER 'India Govt has started clean india mission.'  )

Result
----------------------------------------
(No column name)
-----------------------------------------
 INDIA GOVT HAS STARTED CLEAN INDIA MISSION.


Result
----------------------------------------
(No column name)
-----------------------------------------
india govt has started clean india mission.


12) Date Function

ISDATE :valid date or not

 SELECT MyDate ,ISDATE(MyDate) AS IsValiDate
                                    FROM (
                                                 VALUES 'IsValiDate'   ),
                                                                (  '2012-02-14' ),
                                                                (  '2012-01-01T00:00:00'  ),
                                                                (  '2014-12-31T23:59:59.9999999' )
                                               )   dt(MyDate)

 
Result
--------------------------------------------------------------------------------------------
MyDate                                    |                    IsValiDate
-------------------------------------------------------------------------------------------
 IsValiDate                                                              0
2012-02-14                                                             1
2012-01-01T00:00:00                                            1
2014-12-31T23:59:59.9999999                             0

13) @@IDENTITY && SCOPE_IDENTITY 

@@IDENTITY returns the last identity value generated by any table in the current session. If the insert statement fires a trigger that inserts into another table with an identity column, the value returned by @@IDENTITY will be that of the table inserted into by the trigger.
SCOPE_IDENTITY returns the last identity value generated by any table in the current session and scope. In the previous scenario, SCOPE_IDENTITY returns the identity value returned by the first insert statement, not the insert into the second table from the trigger.

CREATE TABLE TEST
(
    IDX INT IDENTITY ,
    ID INT  ,
    COUNTRY VARCHAR(200)
)

INSERT INTO TEST (ID,COUNTRY)
VALUES    (1  ,  'India'  ),
                   (2  ,  'Brazil' ),
                   (3  ,  'China' ),
                   (4  ,  'Nepal' ),
                   (5  ,  'ian'     ),
                   (6  ,  'en'      ),
                   (7  ,  'an'     ),
                   (8  ,  'am'    ),
                   (9  ,  'em'   ),
                   (10 , 'am'   )

 SELECT @@IDENTITY, SCOPE_IDENTITY(), IDENT_CURRENT('dbo.TEST');

14) ESCAPE 

 SELECT access_name FROM tbl_user
 WHERE  access_name LIKE  '%%%' 












all ,value return , no match for wildcard %

Instead, you can try one of the following solutions:

SELECT access_nameFROM tbl_userWHERE 
    access_name LIKE  '%[%]%' 
 

SELECT access_name FROM tbl_user  WHERE
    access_name LIKE '%\%%' ESCAPE '\'







Wednesday, 3 September 2014

CLASS

1) What is Class ?
           A class is the blueprint from which individual objects.

2) What is constructor ?
A constructor in a class is a special type of subroutine called to create an object. It prepares the new object for use

 class Sample
{
             public string param1, param2;
             public Sample()     // Default Constructor
            {
              param1 = "Welcome";
              param2 = "Aspdotnet-Suresh";
            }
}
 
class Program
{
           static void Main(string[] args)
            {
                      Sample obj=new Sample();   // Once object of class created automatically constructor will be called
                    Console.WriteLine(obj.param1);
                    Console.WriteLine(obj.param2);
                    Console.ReadLine();
            }
}


3) Private & Public & Protected ?

Private :Variables and methods declared with private visibility are not accessible in the child class

Public :Variables and methods declared with public visibility are accessible; but public variables violate our goal of encapsulation

Protected : Variables and methods declared with protected visibility in a parent class are only accessible by a child class or any class derived from that class

4) What is Inheritance ?

Inheritance is when an object or class is based on another object or class, using the same implementation

public class ParentClass
{
           public ParentClass()
           {
           }

           public void print()
           {
        Console.WriteLine("I'm a Parent Class.");
         
} 

}

 public class ChildClass : ParentClass
{
    public ChildClass()
    {
        Console.WriteLine("Child Constructor.");
    }

    public
static void Main()
    {
        ChildClass child =
new ChildClass();
        child.print();
    }
}


5) What is sealed class ?
A sealed class is a class that cannot be inherited. Sealed classes are used to restrict the inheritance


    sealed class SealedClass
    {
        public int x;
        public int y;
    }


6)What is interface ?

An interface contains only the signatures of methods, properties, events or indexers. A class or struct that implements the interface must implement the members of the interface that are specified in the interface definition
 

Using interfaces we can invoke functions from different classes through the same Interface reference, whereas using virtual functions we can invoke functions from different classes in the same inheritance hierarchy through the same reference


interface ISampleInterface
{
    void SampleMethod();
}

class ImplementationClass : ISampleInterface
{
    // Explicit interface member implementation:  
    void ISampleInterface.SampleMethod()
    {
        // Method implementation.
    }

    static void Main()
    {
        // Declare an interface instance.
        ISampleInterface obj = new ImplementationClass();

        // Call the member.
        obj.SampleMethod();
    }
}

7)What is Abstact Class ?

They are classes that cannot be instantiated, and are frequently either partially implemented, or not at all implemented



//Abstract Class1
abstract class absClass1
{
    public abstract int AddTwoNumbers(int Num1, int Num2);
    public abstract int MultiplyTwoNumbers(int Num1, int Num2);
}

//Abstract Class2
abstract class absClass2:absClass1
{
    //Implementing AddTwoNumbers
    public override int AddTwoNumbers(int Num1, int Num2)
    {
        return Num1+Num2;
    }
}

//Derived class from absClass2
class absDerived:absClass2
{
    //Implementing MultiplyTwoNumbers
    public override int MultiplyTwoNumbers(int Num1, int Num2)
    {
        return Num1*Num2;
    } 
} 

8) Abstact Class Vs Interface



                     Interfaces

         Abstract Classes

 A class may inherit several interfaces.
A class may inherit only one abstract class.
Interfaces can only have consts and methods stubs
Abstract classes can have consts, members, method stubs and defined methods, whereas
All methods of an interface must be defined as public
Methods and members of an abstract class can be defined with any visibility
An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public
An abstract class can contain access modifiers for the subs, functions, properties


9) Output Parameter C#


   public void getValues(out int x, out int y )
      {
          Console.WriteLine("Enter the first value: ");
          x = Convert.ToInt32(Console.ReadLine());
          Console.WriteLine("Enter the second value: ");
          y = Convert.ToInt32(Console.ReadLine());
      }
   

        /* local variable definition */
         int a , b;
         
         /* calling a function to get the values */
         n.getValues(out a, out b);


10) Event & Delegates

Delegate and Event concepts are completely tied together. Delegates are just function pointers, That is, they hold references to functions.


11) Override

override stands for use one's authority to reject or cancel

abstract class ShapesClass
{
    abstract public int Area();
}
class Square : ShapesClass
{
    int side = 0;

    public Square(int n)
    {
        side = n;
    }
    public override int Area()
    {
        return side * side;
    } 
} 

12)Overloading


mechanism to have more than one method with same name but with different signature (parameters). A method can be overloaded on the basis of following properties
  1. Have different number of parameter
  2. Having same number of parameters but of different type
  3. Having same number and type of parameters but in different orders

public class test
{
    public void getStuff(int id)
    {}
    public void getStuff(string name)
    {}
}

13)What is virtual keyword ?
 
            The virtual keyword is used to modify a method, property, indexer, or event declaration   and allow for it to be overridden in a derived class. For example, this method can be overridden by any class that inherits it.


      When a virtual method is invoked, the run-time type of the object is checked 
for an overriding member. The overriding member in the most derived class is 
called, which might be the original member, if no derived class has overridden 
the member.
 
        class A
        {
           public virtual void Test()
           {
         Console.WriteLine("A.Test");
           }
        }

         class B : A
         {
          public override void Test()
          {
     Console.WriteLine("B.Test");
          }
         }

14)

Thursday, 12 December 2013

.Net fundamental

1)Which ADO.NET object is very fast in getting data from database?

   DataReader is the  object which retrieve data from database verifiable.
   for example SqlDataReader , OledbDataReader

   DataReader is the object which was introduced in .net from earlier version. Even Dataset use
   DataReader  object internally for data retrieving.DataReader use connected data retrieval only
  
2)Explain about the relationship of XML and ADO.NET?

ADO.Net was intoduced in .net framework.ADO.Net dataset is a class for handling  data operation.Data fetch, update etc. ADO.Net dataset is of two type a)Typed and b)Untyped dataset.Both are derived from dataset class.

a)Typed dataset : It is derived from ADO.Net dataset and all method , event,property also from ADO.Net class.When a typed dataset is generated at design time, a dataset class and an associated XML Schema is created.XML Schemas define and validate the data being imported from XML streams or documents into typed datasets.

b)Untyped dataset : It is derived from ADO.Net also.

3)Explain about Data access objects or DAO?

4)How to add auto increment column in the DataTable?

It is a tricky question , asked by employer , to know in depth knowledge of a candidate.
Datatable also an inmemeory representation.Data table had a property called "AutoIncrement" 
thta is DataColumn.AutoIncrement 

DataTable table = new DataTable("mytable");
 
DataColumn mycolumn = new DataColumn();
column.DataType = System.Type.GetType("System.Int32");
column.AutoIncrement = true;
table.Columns.Add(mycolumn);
 
5)Stored procedure return more than one resut set and datareader used to fetch record, how you fetch 6)second result set using datareader?
7)What is the use of DataSet.HasChanges() Method?

Gets indicating whether the  dataset  has changes, including new, deleted, or modified rows.
   if(mydataSet.HasChanges()) return;

Sometimes programetically  we cange the value of a datatable , add new row, delete row, modify    value of column.Or some times add a new datatable added to dataset.

To determine if the value has change , HasChanges() property is used
  

8)What is the use of SqlCommandBuilder?
A Command object is used to execute scalar or non query commands to a Databse.

It comes under System.Data.Sqlclient.It is a sealed class.

SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand(myQueryString, connection);
SqlCommandBuilder builder = new SqlCommandBuilder(da );
builder.GetUpdateCommand(); 
 

9)What is the difference between Typed and UnTyped DataSets?
Dataset is derived from System.Data.DataSet.There are two type of dataset , Typed and untyped dataset.Both are dataset but have some major advantages of Typed dataset over untyped dataset.Mainly when we declare a dataset ,it is untyped dataset , but .Xsd file is a good example of typed dataset

untyped dataset
dataset ds=new dataset();

typed dataset is and .xsd file
now  what more on typed dataset ?
Typed dataset maintain schema .Foreign key and others reference,Relation between tables.
we can not violate the database integrity programetically form typed dataset
 

10)Differences between DataSet and DataReader

DataSet

DataReader

Can perform both Read/Write
Can perform only Read-only operation
Can return /contain multiple tables from different databases
Can read on a single result set of one database
Disconnected mode
Connected mode
Can bind to multiple controls
Can bind to a single control
Forward and backward scanning of data, any point of data can be access
Forward-only scanning of data
Slower access to data
Faster access to data
Greater overhead to enable additional features
Lightweight object with very little overhead
 Internally XML is used for storing of data.
No scope of storing of data.




11)How do you create a permanent cookie ?

It is also termed as persistent cookie or a stored cookie

cookie that is stored on a users hard drive until it expires or until the user deletes the cookie. This cookies are used to collect identifying information about the user, such as Web surfing behavior or user preferences for a specific Web site.Expire date are set to get expired

Add cookie
var myCookie = new HttpCookie("myCookie ");
myCookie .Values.Add("Id", "some_information");
panelIdCookie.Expires = DateTime.Now.AddMonths(2); 
Response.Cookies.Add(myCookie );
 
Read cookie
 var httpCookie = Request.Cookies["myCookie "];
 if (httpCookie != null)
 {
   myId = Convert.ToInt32(httpCookie["Id"]);
 }
 


12)What is gacutil.exe?

 gacutil stands for Global Assembly Cache (GAC),it is for the Common Language Infrastructure (CLI).It is automatically installed when a visual studio is installed,to run the tool we have to go to
"Command Prompt".gacutil accept three parameters

assemblyName,assemblyPath,assemblyListFile

we can see the gacutil.exe like the path
 %programfiles%\Microsoft Visual Studio .NET 2005\SDK\v1.1\Bin\gacutil.exe


13)Difference between Response.Expires and Response.ExpiresAbsolute?

Response.Expires
Specifies the number of minutes before a page cached in the browser expires . if the user returns to the same page before the specified number of minutes the cached version of the page is displayed.
Response.Expires = 40
Response.Cache.SetNoStore()
by this  cached in the browser expires in 40 minutes

Response.ExpiresAbsolute
This can set the date and/or time at which page cached in the browser expires.
 <% Response.ExpiresAbsolute=#May 31,2013 13:30:15# %>

14)What is CLR (Common Language Runtime)?

                                     It is a  run-time environment called the common language runtime, which runs the code and provides services that make the development process easier.
                                   The term service refers to as a collection of services that are required to execute a code. The beauty of CLR is that all .NET-supported languages can be executed under this single defined runtime layer. The spinal cord of CLR is represented by a library refers to as mscoree.dll (common object runtime execution engine). When an assembly is referenced for use, mscoree.dll is automatically loaded.
                                 The CLR first locates the referenced assembly, and then it loads it into memory, compiles the associated IL code into platform specific instructions, performs security related checks, and finally executes the code.
 
Role of CLR in DOT.NET Framework
Base Class Libraries: It provides class libraries supports to an application when needed.
Debug Engine: CLR allows us to perform debugging an application during runtime. Thread Support: Threads are managed under the Common Language Runtime
Manages memory: Allocation of Memory,De-Allocation of Memory (garbage collation)
Compilation

                                Common Language Runtime (CLR) is a language-independent runtime environment . The Common Language Runtime (CLR) environment is also referred to as a managed environment, because during the execution of a program it also controls the interaction with the Operating System


15)What is CTS?

                               CTS stands for Common Type System. It confirm how Type definitions and specific values of Types are represented in computer memory.Which establishes a framework that helps enable cross-language integration, type safety, and high-performance code execution.Provides an object-oriented model that supports the complete implementation of many programming languages
                            
                              The language interoperability, and .NET Class Framework, are not possible without all the language sharing the same data types.This is exactly what's done in the Common Type System (CTS). A fundamental part of the .NET Framework's Common Language Runtime (CLR), the CTS specifies no particular syntax or keywords, but instead defines a common set of types that can be used with many different language syntaxes. Each language is free to define any syntax it wishes, but if that language is built on the CLR, it will use at least some of the types defined by the CTS.
                            These types can be Value Types or Reference Types . The Value Types are passed by values and stored in the stack. The Reference Types are passed by references and stored in the heap. Common Type System (CTS) provides base set of Data Types which is responsible for cross language integration. The Common Language Runtime (CLR) can load and execute the source code written in any .Net language, only if the type is described in the Common Type System (CTS) .Most of the members defined by types in the 
                            
      


16)What is CLS?
17)What is MSIL?

Full form of  MSIL is Microsoft Intermediate Language.Also called  Intermediate Language (IL) / Common Intermediate Language (CIL). While compile , the compiler convert the source code into Microsoft Intermediate Language (MSIL).MSIL includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations.
Combined with metadata and the common type system, MSIL allows for true cross- language integration Prior to execution, MSIL is converted to machine code. It is not interpreted.

18)What is Satellite Assembly?
19)Can you place two .dll files with the same name in GAC (Global Assembly Cache)?
20)What's the difference between private and shared assembly?

Private Assembly
                                A private assembly is normally used by a single application, and is stored in the application's directory, or a sub-directory beneath.
                               The disadvantage of using private assemblies is that they have to be copied into every application that uses it. This results in increased disk space requirements on the target machine - the same private assembly is copied to disk multiple times - and in memory requirements - the same DLL loaded from different locations is seen by Windows as a different module and is allocated separate physical memory.

Shared Assembly
                         A shared assembly is an assembly available for use by multiple applications on the computer.This type of assembly can be used in situations where it is not necessary to install a version of an assembly for each application that uses it


21)What is the location of Global Assembly Cache on the system.

22)What is JIT (Just-in-time) Compiler ?
A compiler that converts program source code into native machine code just before the program is run. Compilation is a executes in two-steps.It required an  Virtual Machine which is able to execute
execute your code.
Step 1
Convert  your program to a bytecode understandable by Virtual Machine. .NET  is called Common Intermediate Language or CIL. It is also known as Microsoft Intermediate Language (MSIL) or just Intermediate Language (IL)

Step 2
Virtual Machine  converts only executed MSIL  into CPU instructions at runtime.

23)What is Managed and Unmanaged code?
24)What is the difference between Namespace and Assembly?
25)What is Manifest?
26)What is Metadata?
27)What is CODE Access security?
28)What’s difference between System.SystemException and System.ApplicationException?
30)Dictionary objects 

Contain collection of keys and values.comes under System.Collections.Generic
Dictionary<TKey, TValue>()

Example
public class AClass
{
Dictionary<int, dynamic> sp = new Dictionary<int, dynamic>
{
{1, new {name="Ram", age="18"}}
{2, new {name="Sham", age="22"}}
}
}

Now how to read dictionary object?
 
AClass obj = new AClass(); 
 
foreach (var item in obj.sp)
{
    Console.Write(item.Key);
    Console.Write(item.Value.name);
    Console.Write(item.Value.age);
} 


31)What is ResolveUrl ?

Converts a URL into one that is usable on the requesting client .
For example i have a path
../event/play/sport.aspx
Now some other path , i have to redirect to the sport.aspx page
Say i am in a path
../event/study/class.aspx
i have to rend the redirect to
../event/play/sport.aspx

if i write  string postTo=ResolveUrl(`~/sport.aspx);
Response.write( postTo.totsring());
Result
../event/study/class.aspx 

বাঙালির বেড়ানো সেরা চারটি ঠিকানা

  বাঙালি মানে ঘোড়া পাগল | দু একদিন ছুটি পেলো মানে বাঙালি চলল ঘুরতে | সে সমুদ্রই হোক , পাহাড়ি হোক বা নদী হোক। বাঙালির ...