|
MVC 2
|
MVC 3
|
|
.aspx view engine
|
.cshtml view engine
|
|
There is no life cycle in mvc
page.
|
There is no life cycle in mvc
page.
|
|
Have TempData, ViewData
|
Supported by ViewBag
|
|
No have ! Chart, WebGrid, WebImage, WebMail
|
Its have Chart, WebGrid, WebImage, WebMail
|
|
It have <%=Html code %>
|
But @Html code
|
|
Don’t write the c# code within
View engine page.
|
write the c# code within View engine
page.
|
|
|
|
|
|
|
Monday, September 10, 2012
difference between mvc 2 and mvc 3 in asp.net
Boxing and Unboxing in C#
Boxing
Boxing is
implicit conversion. The Main purpose of Boxing is used to convert value types
into reference type or object type and store in the heap.
Example: int
i = 1;
Boxing a
value type allocates an object instance on the heap and copies the value into
the new object.
Example: //
Boxing copies the value of i into object o.
object
o = i;
The result
of this statement is creating an object reference o, on the stack, that
references a value of the type int, on the heap.
This value
is a copy of the value-type value assigned to the variable i.
It also
possible to perform the boxing explicitly as in the following
Example,
but explicit boxing is never used.
int i = 1;
object o = (object)i; // explicit boxing
Example:
public class TestBoxing
{
public static void Main()
{
int i = 1;
// Boxing copies the value of i into object o.
object o = i;
// Change the value of i.
i = 4;
// The change in i does not effect the value stored in o.
Console.WriteLine("The value-type value =", i);
Console.WriteLine("The object-type value =", o);
}
}
/* Output:
The value-type value = 4
The object-type value = 1
*/
Un-Boxing
Unboxing is
an explicit conversion. The Main purpose of Un-Boxing is used to convert the
object type or reference type to a value type and store in the stack.
Example:
int i = 1; // a value type
object o = i; // boxing (implicit conversion)
int j = (int)o; // Unboxing (explicit conversion)
Friday, September 7, 2012
How to remove duplicate rows in SQL Server
delete from dbo.tblSalary
where
emp_salary in(
select emp_salary as [Salary Result] from
dbo.tblSalary
group
by emp_salary
having
count(emp_salary)>1)
Noted point: dbo.tblSalary = “Table-Name”
emp_salary = “Column-Name”
Subscribe to:
Posts (Atom)

