Saturday 9 June 2012

Important Functions used in sql server 2008/2005

The TOP Clause

The TOP clause is used to specify the number of records to return.
The TOP clause can be very useful on large tables with thousands of records. Returning a large number of records can impact on performance.

 Syntax

SELECT TOP number|percent column_name(s)
FROM table_name

Monday 4 June 2012

How dll hell problem solve in .net

Dll Hell refers to a set of problems caused when multiple 
applications attempt to share a common component like a 
dynamic link library (DLL). The reason for this issue was 
that the version information about the different components 
of an application was not recorded by the system. 

Main Difference between C#3.0 vs c#4.0

C# 4.0
C# 3.5
C# 4.0 supports dynamic programming through dynamic objects.
C# 3.5 does not support dynamic programming.
In C# 4.0, dynamic keyword is associated with objects to represent them as dynamic objects.
The dynamic keyword is not recognized in C# 3.5.
C# 4.0 allows creation of dynamic variables.
Dynamic variables cannot be created in C# 3.5.
In C# 4.0, the method parameters can be specified with default values using optional parameters.
In C# 3.5, method parameters cannot be specified with default values. C# 3.5 does not support optional parameters.
C# 4.0 provides named parameters to represent the values of method parameters without following the order of declaration.
In C# 3.5, method parameters have to be specified in the same order as in method declaration in the method call. C# 3.5 does not provide named parameters.
In C# 4.0, usage of ref keyword is optional while executing methods which are supplied by the COM interfaces.
In C# 3.5, usage of ref keyword is mandatory while executing methods which are supplied by the COM interfaces.
The COM object’s indexed properties are recognized in C# 4.0.
The COM object’s indexed properties are not recognized in C# 3.5.
C# 4.0 enhances Generics by introducing co-variance and contra-variance.
Co-variance and contra-variance are not supported in Generics of C# 3.5.

Friday 1 June 2012

How can we make calculator in vb.net

 This is the simple code of calculator:-

Public Class Form2
    Dim total1 As Integer
    Dim total2 As Integer
    Dim sign As String
    Dim opr As String

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = TextBox1.Text & "0"
    End Sub

Difference between primitive type and non primitive data type in C#

There are two types of data type in C#

primitive data types are the datatypes which are not objects as they are present in c and c++. eg.int,char,float etc.
where as non primitive are the datatypes which are considered as objects eg. String.
This is one of the reason why java is not a purely object oriented lang as the primitive data types are also allowed in java