Saturday, 7 November 2009

What is difference between TRUNCATE & DELETE?

TRUNCATE SQL Command:

TRUNCATE is faster and uses fewer system and transaction log resources than DELETE.

TRUNCATE removes the data by deallocating the data pages used to store the table’s data, and only the page deallocations are recorded in the transaction log.

TRUNCATE removes all rows from a table, but the table structure and its columns, constraints, indexes and so on remain. The counter used by an identity for new rows is reset to the seed for the column.

You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint.

Because TRUNCATE TABLE is not logged, it cannot activate a trigger.

TRUNCATE can not be Rolled back.

TRUNCATE is DDL Command.

TRUNCATE Resets identity of the table.

DELETE SQL Command:

DELETE removes rows one at a time and records an entry in the transaction log for each deleted row.

If you want to retain the identity counter, use DELETE instead. If you want to remove table definition and its data, use the DROP TABLE statement.

DELETE Can be used with or without a WHERE clause
DELETE Activates Triggers.
DELETE can be Rolled back.
DELETE is DML Command.
DELETE does not reset identity of the table.

-----------------------------------------------------------
This is the most appropriate answer.
-----------------------------------------------------------


Is This Answer Correct ? 0 Yes 0 No

Monday, 2 November 2009

C# question:-

1.Which is the default access modifier of Interface?
Ans:-Public
2.f the method is___________,then we can call the method without creating the instance of the class.
A:-Static
3. Is it possible to restrict accessibility of base class method to child class?
A:Yes
4.Which is the top .NET class from which all thing is derived?
A:System.object
5.What is Denormalization???
A:-De normalization is a technique to move from higher to lower normal forms of database modeling in order to speed up the query processing.
6.In C# Thread.Sleep(time) measures time in:
A:-milliseconds
7.Every class directly or indirectly extends the______class.
A:-Object
8.A variable declared inside a method is called a________variable?
A:-Local
9.An instance method is
A:-Represents the behavior of an object
10.Difference between Value Types and Reference Types?
A:-Value types directly contain their data (while) Reference types can be self-describing types
11. how to pass double "quoted string " with in string variable?
a:-@"""premjit Mohanty"""
12.The maximum size of the textbox is
a:-65536
13.

SET THE COOKIE

SET THE COOKIE

Response.Cookies["test"].Value = TextBox1 .Text ;

Response.Cookies["test"].Expires = DateTime.Now.AddYears(30);

After that

How to Expried Cookie

Response.Cookies["test"].Expires = DateTime.Now.AddYears(-30);

How to Write/Read cookie

/////////check to see if cookie presented//////////

if (Request.Cookies["test"] == null)

{

TextBox2.Text = "No cookie found";

}

Else

{

TextBox2 .Text = Request.Cookies["test"].Value;

}

/////////END check to see if cookipresented//////////

Saturday, 31 October 2009

basic concepts of OOPS

The following are the basic concepts of OOPS.
1)Objects
2)Classes
3)Data Abstraction
4)Data Encapsulation
5)Inheritance

6)Polymorphism
7)Message Passing
8)Reusability
9)Dynamic Binding
10)Methods

Thursday, 22 October 2009

What is difference between Trigger and a Stored Pr.

TRIGGER

1- when you create a trigger you have to identify event and action of your trigger but when you create s.p you don't identify event and action

2-trigger is run automatically if the event is occured but s.p don't run automatically but you have to run it manually

3- within a trigger you can call specific s.p but within a s.p you cann;t call atrigger



Difference between Truncate and Delete ?
Truncate is a DDL command and hence cant be rolled back
Truncate can not fire a trigger.
Truncate is unconditional.
Truncate removes all records but using this we cannot
remove a particular record.
where as delete is DML command and thus can be rolled back.
Delete can fire a trigger.
We can specify a condition while using deletecommand.