What is the disadvantage of LINQ over stored procedures?



The disadvantage with LINQ is, it is not a precompiled statement where as stored procedures are precompiled. In case of LINQ the queries need to be compile before the execution. So according to this, I can say stored procedures are faster in performance as compared to LINQ.

What are differences between function and stored procedure?



1) Function returns only one value but procedure returns one or more than one value.
2) Function can be utilized in select statements but that is not possible in procedure.
3) Procedure can have an input and output parameters but function has only input parameters only.
4) Exceptions can be handled by try catch block in procedures but that is not possible in function.


Foxs, suggest me to improve the answer if you have any extra points.

Thanks. 

Difference Between Candidate Keys and Primary Key

primary key:-  The attribute or combination of attributes
that uniquely identifies a row or record.

Foreign Key:- an attribute or combination of attribute in a
table whose value match a primary key in another table.

Composite key:- A primary key that consistsof two or more
attributes is known as composite key

candidate key:-  is a column in a table which has the
ability to become a primary key.

Alternate Key:- Any of the candidate keys that is not part
of the primary key is called an alternate key.
 
 
I like to share this link
 
http://www.dotnet-tricks.com/Tutorial/sqlserver/GcF9120312-Different-Types-of-SQL-Keys.html  

Why String is a reference type while Interger is a Value type

An integer has fixed memory set at 4 bytes.  
Hence, an integer can be directly stored within fixed memory, or on the stack.

A string does not have a pre-defined memory size, so it requires dynamic memory. 

When a string object is created, the actual value is stored within dynamic memory, or on the heap.

To access it, a reference to this memory space is stored in the stack, thus the name "reference type".

Use of Abstract class

The advantage is that it enforces certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all the subclasses to carry on the same hierarchies or standards.

const Vs readonly

A constant member is defined at compile time and cannot be changed at runtime. Constants are declared as a field, using the const keyword and must be initialized as they are declared.

public class MyClass
{
    public const double PI1 = 3.14159;
}


A readonly member is like a constant in that it represents an unchanging value. The difference is that a readonly member can be initialized at runtime, in a constructor as well being able to be initialized as they are declared.
public class MyClass1
{
     public readonly double PI2 = 3.14159;

     //or

     public readonly double PI3;

     public MyClass2()
     {
         PI3 = 3.14159;
     }
}
const Vs readonly
const,
  • They Can not be static
  • The value of constant is evaluated at compile time
  • constants are initiailized at declaration only
readonly,
  • They Can be either instance-level or static
  • The value is evaluated at run time
  • readonly Can be initialized in declaration or by code in the constructor 
----------------------------------------------------------------------------

Additionally want to know this: Garbage Collection

    Class Diagram

    I have found basic and understand information here. 

    http://www.studentcpu.com/2009/11/class-diagram-for-bank-process-online.html