Thursday, July 24, 2008

Implementing Two interface having the same method signature in the same class


public interface MyInterface
{
int Add();
}
public interface MyInterface1
{
int Add();
}
class ClsInterface:MyInterface,MyInterface1
{
int MyInterface.Add()
{
Console.WriteLine("return 0");
return 0;
}
int MyInterface1.Add()
{
Console.WriteLine("return 1");
return 1;
}
public static void Main(string[] args)
{
MyInterface I1 = new ClsInterface();
MyInterface1 I2 = new ClsInterface();
I1.Add();
I2.Add();
Console.ReadLine();
}
}

Thursday, June 12, 2008

How to get the records while Inserting, updating and deleting in sql server 2005

There are three default inbuild tables, they are inserted, deleted. For both insert and update commands, the affected values are stored into inserted table and for delete command, the affected values are stroed into deleted .Example for insert.UPDATE Emp SET emp_present=1 output Inserted.*DELETE FROM emp output deleted.*