First Install SQL Server 2008, Visual Studio 2008 and Adventure Works Database:
1. SQL Server Server Installations Files:
http://www.microsoft.com/downloads/details.aspx?FamilyId=265F08BC-1874-4C81-83D8-0D48DBCE6297&displaylang=en
2. Visual Studio 2008 Installations Files:
http://www.microsoft.com/visualstudio/en-us/downloads/microsoft-downloads.mspx
3. Adventure Works Database Installation:
http://msftdbprodsamples.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=18407
Complete the above 3 installation and proceed for making Cubes in Data Warehousing.
Friday, 26 June 2009
Thursday, 25 June 2009
How to Disable UAC - User Account Control in Windows Vista
Tuesday, 23 June 2009


using System;
public class EHclass
{
public static void Main()
{
try
{
Console.WriteLine("executing the try statement");
throw new NullReferenceException();
}
catch(NullReferenceException e)
{
Console.WriteLine("{0}caught exception #1",e);
}
catch
{
Console.WriteLine("caught exception #2");
}
finally
{
Console.WriteLine("executing the finally block");
}
}
}



using System;
class Testclass
{
public class Dimensions
{
public const double pi=Math.PI;
protected double x,y;
public Dimensions()
{
}
public Dimensions (double x,double y)
{
this.x=x;
this.y=y;
}
public virtual Double Area()
{
return x*y;
}
}
public class circle:Dimensions
{
public circle(double r):base(r,0)
{
}
public override double Area()
{
return pi*x*x;
}
}
class sphere:Dimensions
{
public sphere(double r):base (r,0)
{
}
public override double Area()
{
return 4*pi*x*x;
}
}
class cylinder:Dimensions
{
public cylinder (double r,double h):
base (r,h)
{
}
public override double Area()
{
return 2*pi*x*x+2*pi*x*y;
}
}
public static void Main()
{
double r=3.0,h=5.0;
Dimensions c=new circle(r);
Dimensions s=new sphere(r);
Dimensions l=new cylinder(r,h);
Console.WriteLine("Area of circle={0:f2}",c.Area());
Console.WriteLine(c.Area());
Console.WriteLine("Area of sphere={0:f2}",s.Area());
Console.WriteLine("Area of cylinder={0:f2}",l.Area());
}
}



public class MyBase
{
public virtual string Meth1()
{
return "MyBase-Meth1";
}
public virtual string Meth2()
{
return "MyBase-Meth2";
}
public virtual string Meth3()
{
return "MyBase-Meth3";
}
}
class MyDerived:MyBase
{
public override string Meth1()
{
return "MyDerived-Meth1";
}
public override string Meth2()
{
return "MyDerived-Meth2";
}
public override string Meth3()
{
return "MyDerived-Meth3";
}
public static void Main()
{
MyDerived md=new MyDerived();
MyBase mb=new MyBase();
System.Console.WriteLine(mb.Meth1());
System.Console.WriteLine(mb.Meth2());
System.Console.WriteLine(mb.Meth3());
}
}


using System;
class overload{
class c1{
public int i;
public c1(int k)
{
i=k;
}
public static bool operator>(c1 aa,c1 bb)
{
return aa.i>bb.i;
}
public static bool operator<(c1 aa,c1 bb)
{
return aa.i
}
}
public static void Main()
{
c1 obj1=new c1(100);
c1 obj2=new c1(20);
if (obj1>obj2)
Console.WriteLine("True");
else
Console.WriteLine("false");
if (obj1
Console.WriteLine("True");
else
Console.WriteLine("false");
}
}


using System;
class Fraction
{
int num,den;
public Fraction(int num,int den)
{
this.num=num;
this.den=den;
}
public static Fraction operator + (Fraction a,Fraction b)
{
return new Fraction (a.num*b.den+b.num*a.den,a.den*b.den);
}
public static Fraction operator *(Fraction a,Fraction b)
{
return new Fraction (a.num*b.num,a.den*b.den);
}
public static implicit operator double
(Fraction f)
{
return (double)f.num/f.den;
}
}
class Test
{
public static void Main()
{
Fraction a=new Fraction(1,2);
Fraction b=new Fraction(3,7);
Fraction c=new Fraction(2,3);
Console.WriteLine((double)(a*b+c));
}
}



using System;
class main1
{
public static void Main()
{
final f=new final();
f.cars();
f.price(f.name);
}
}
interface a
{
void cars();
}
interface b
{
void price (string na);
}
class final:a,b
{
public string name;
public void cars()
{
Console.WriteLine("enter name of car");
Console.WriteLine("\n1.BMW\n2.ZEN\n3.ALTO");
name=Console.ReadLine();
}
public void price (string na)
{
switch (na)
{
case "BMW":
Console.WriteLine("Twenty five crore");
break;
case "ZEN":
Console.WriteLine("TWenty crore");
break;
case "ALTO":
Console.WriteLine(" five crore");
break;
default:
Console.WriteLine("check the spell");
break;
}
}
}



using System;
class class1
{
}
class class2
{
}
public class IsTest
{
public static void Test (object o)
{
class1 a;
class2 b;
if (o is class1)
{
Console.WriteLine("0 is class1");
a=(class1)o;
}
else if (o is class2)
{
Console.WriteLine("o is class2");
b=(class2)o;
}
else
{
Console.WriteLine("o is neither class1 nor class2");
}
}
public static void Main()
{
class1 c1=new class1();
class2 c2=new class2();
Test(c1);
Test(c2);
Test("a string");
}
}



using System;
delegate void mydelegate();
public class myclass
{
public void instancemethod()
{
Console.WriteLine("A message from the instance method");
}
static public void staticmethod()
{
Console.WriteLine("A message from the static method");
}
}
public class Mainclass
{
static public void Main()
{
myclass p=new myclass();
mydelegate d=new mydelegate(p.instancemethod);
d();
d=new mydelegate(myclass.staticmethod);
d();
}
}

Subscribe to:
Comments (Atom)

























