title: Using of Linq to SQL in Three tier architecture in asp.net 4.5
body: <p>i need to develop a project in three tier Architecture ..but i do not know how to use linq in project and in which layer i should use ..following is my code for three layer
  business layer, dataccess layer and presentation layer, business object layer for declaring table variable</p>
  
  <p>business object layer</p>
  
  <pre><code>  namespace BusinessObject
    {
     public  class UserBO // Declare Class Public to Access any where
      {
          //Declaring UserInfomation Variables
  
     private string _Id;
     private string _LogInName;
     private string _FirstName;
     private string _LastName;
     private string _EmailAddress;
     private string _Password;
  
     public string Id
     {
         get { return _Id; }
         set { _Id = value; }
     }
     // Get and set values
     public string LogInName
     {
         get { return _LogInName; }
         set { _LogInName = value; }
     }
     public string FirstName
     {
         get { return _FirstName; }
         set { _FirstName = value; }
     }
     public string LastName
     {
         get { return _LastName; }
         set { _LastName = value; }
     }
     public string EmailAddress
     {
         get { return _EmailAddress; }
         set { _EmailAddress = value; }
  
     }
     public string Password
     {
         get { return _Password; }
         set { _Password = value; }
     }
  </code></pre>
  
  <p>dataccess layer</p>
  
  <pre><code>SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ToString());
      public int AddUserDetails(UserBO objbo) // passing Bussiness object Here
      {
          try
          {
              /* Because We will put all out values from our (UserProfile.aspx)
                To in Bussiness object and then Pass it to Bussiness logic and then to
                DataAcess
                this way the flow carry on*/
              SqlCommand cmd = new SqlCommand("USERINFORMATION", con);
              cmd.CommandType = CommandType.StoredProcedure;
              cmd.Parameters.AddWithValue("@Id", objbo.Id);
              cmd.Parameters.AddWithValue("@LogInName", objbo.LogInName);
              cmd.Parameters.AddWithValue("@FirstName", objbo.FirstName);
              cmd.Parameters.AddWithValue("@LastName", objbo.LastName);
              cmd.Parameters.AddWithValue("@EmailAddress", objbo.EmailAddress);
              cmd.Parameters.AddWithValue("@Password", objbo.Password);
              con.Open();
              int result = cmd.ExecuteNonQuery();
              cmd.Dispose();
              return result;
          }
          catch
          {
              throw;
          }
      }
  </code></pre>