Sunday, 9 August 2015

What is Shared Assembly in .Net

             An assembly that resides in a centralized location known as GAC(Global Assembly Cache) and provides resources to any number of projects that wants to consume is known as a shared Assemblies. If an assembly is shared multiple copies will not be created even if being consumed by multiple projects, only single copy under GAC serves all the project. GAC is folder that is present under the windows Folder.

What is difference between DataSet.Copy() and DataSet.Clone()

 DataSet.Copy() : 
  1. It copies both structure and Data.
  2. Methods copies all the Dataset including it's datatables schemas, constraints along with the data.
                        DataSet  s;
                          DataSet s1;
                            s1= s.Copy();

DataSet.Clone() : 
  1. It only copies structure, doesn't copy Data.
  2. Copies only structure of the dataset. It includes all datatable schemas their contraints and excluding data in those datatables.
                          DataSet  s;
                          DataSet s1;
                            s1= s.Clone();




  

Find the Biggest value in Array without using predefined methods in C#.net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Biggestvalueinarray
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a={22,3,44,32,99,2100,222,443,533};
            for (int i = 0; i < a.Length; i++)
            {
                int temp = 0;
                for (int j = i + 1; j < a.Length; j++)
                {
                    if (a[i] > a[j])
                    {
                        temp = a[i];
                        a[i] = a[j];
                        a[j] = temp;
                    }
                }
            }
          //  Array.Sort(a);
            Console.WriteLine(a[0]);
            Console.WriteLine(a[a.Length -1]);
            Console.Read();
        }
    }
}

What is difference Marshalling and Un-Marshalling

          After serializing the data which has to be sent to the target machine it packages the data into packets this is what we call as marshalling, At this time it associates the IP Address of the target machine where the information has to be sent.
         UnMarshalling is in opposite to Marshalling which opens the packets of data for de-serializing.

What is dfference between Reference type and value types

All the datatypes of .Net are classified into Value types and Reference types.
              Value types are the data types whose values directly stored in the variable within the stack memory area.                          
               Reference types are the data type whose values are stored in the Heap Memory area and his address is stored in the variable in stack . 
              Among the built in data types of .Net string and Object are reference type and all remaining data types are value types among the user defined data types structure and enumeration are value types and class, interface, delegate and arrays are reference types.          

What is difference between undefined and Null


Null :Null is a special value meaning “no value” . Null is a special object because “type of Null” returns “object”.
Undefined  : Undefined means that the variable has not been declared  or has not been given a value.
   Ex: //  k is not declared anywhere in code.
                  Alert(typeof i);

Sunday, 26 July 2015

What is Interoperability in C#.Net

                The earlier .Net languages can interoperability with each other.  i.e The code written in one .Net language after compilation can be consumed from any other .Net language. To check this add  a new project under my solution choosing the language as visual basic , template as class library and name the project as vb project. A class library is a collection of type which can only be consumed but not executed.