Wednesday, 2 January 2013

how to find the total duplicate records in our table ...

how to find the total duplicate records in our table ...

Tuesday, 11 December 2012

You are planning to write client-side JavaScript that must retrieve and display a string Value returned by a server-side method. You want the messages ...

You are planning to write client-side JavaScript that must retrieve and display a string Value returned by a server-side method. You want the messages ...

Write a C# sharp Program to check wheather the given string is Palindrome or not. (Ex: LEVEL is palindrome).Don't use inbuild string functions. ...

Write a C# sharp Program to check wheather the given string is Palindrome or not. (Ex: LEVEL is palindrome).Don't use inbuild string functions. ...

FAQ in Dotnet and Android

FAQ in Dotnet and Android

stopwatch example in c#


In c# provides a unique way of packing together different data types called as struct.
Struct is a simple lightweight alternative to class,but struct are basically same as class even though they have some significant difference between struct and class.
Classes
Structs
Classes are declared using Class keyword
Struct are declared using Struct keyword
Its  a refrence type therefore its stored on the heap
It’s a value type and therefore stored on the stack
Support inheritance
Does not support inheritance
Default value of the class type is null
Default value is the value produced by ‘zeroing out’
Permit initialization of instance fields
Do not Permit initialization of instance fields
Permit declaration of parameterless constructors
Do not Permit declaration of parameterless constructors
Destructors is supported
Destructors is not supported
Assignment copies the reference
Assignment copies the vaues

Difference and performance between Array and ArrayList in C#


Arrays:
  • Arrays are fixed size .
  • It’s used the namespace as System.
  • Array cannot resize automatically.
  • But in Vb.net array can resize themself by using ReDim Statement.When using ReDime array can losses the data and its modify the array structure as mention in the ReDim statement.
  • But this ReDim statement is not available in C#.
  • Array has contains one data type i.e. Homogenous data type.
  • Arrays are multidimensional.
  • The data in an array is accessed by indexes.
  • For performance always recommended using arrays.
  • If you delete an item in an array, it keeps that position empty, its wait for anther data to fill the positions.

Syntax:
string[] str = new string[5];
            str[0] = "DotNet";
            str[1] = "DotnetCode";           
ArrayList:
  • ArrayList are variable in size.
  • It’s used the namespace as System .Collections
  • ArrayList grows automatically i.e. the numbers of items are added to the arrayList.
  • ArrayList contain many data types i.e. heterogenous data type. In a single Arraylist we can store any data type - integer, string and any type of object inherited from System.Object. 
  • ArrayList is always single-dimensional.
  • If you delete an item in an arraylist, that position is occupied by the next element. 
  • We can add, insert and delete items into an ArrayList.

Syntax:

ArrayList astr = new ArrayList();
            astr.Add("str");
            astr.Remove("str");
            astr.RemoveAt(0);
Check the performance between Array and ArrayList in C#

        int[] rate = new int[501];
        ArrayList str1 = new ArrayList();
        Stopwatch watch = new Stopwatch();
        watch.Start();
        for (int i = 0; i <= 500; i++)
        {
            rate[i] = i;
        }
        watch.Stop();
        Response.Write("ARRAY SECONDS :" + watch.Elapsed.TotalMilliseconds);

watch.Reset();
        watch.Start();
        for (int i = 0; i <= 500; i++)
        {
            str1.Add(i);
        }
        watch.Stop();
        Response.Write("ARRAYLIST SECONDS :" + watch.Elapsed.TotalMilliseconds);
Result :

When compare Performance array is better than ArrayList

ARRAY SECONDS :0.0035ARRAYLIST SECONDS :0.0194

You want to disable the existing trigger named Sales.Order_Count that applies to the Sales table. You might need to re-enable this trigger in the futu ...

You want to disable the existing trigger named Sales.Order_Count that applies to the Sales table. You might need to re-enable this trigger in the futu ...

SharePoint Interview Questions and Answers - Page 2

SharePoint Interview Questions and Answers - Page 2

SharePoint Interview Questions and Answers - Page 2

SharePoint Interview Questions and Answers - Page 2