title: Linq update query
body: <p>I want to update an existing record. I also have debugged my code. The int id variable gets the value, but I don't know why my record doesn't updated.</p>
  
  <pre><code>SQLDBDataClassesDataContext dContext = new SQLDBDataClassesDataContext();
  protected void Page_Load(object sender, EventArgs e)
  {
      //if (!IsPostBack)
      {
          if (!string.IsNullOrEmpty(Request.QueryString["fname"]))
          {
              FirstNameTextBox.Text = Request.QueryString["fname"];
          }
          if (!string.IsNullOrEmpty(Request.QueryString["lname"]))
          {
              LastNameTextBox.Text = Request.QueryString["lname"];
          }
          if (!string.IsNullOrEmpty(Request.QueryString["cellnum"]))
          {
              CellNumberTextBox.Text = Request.QueryString["cellnum"];
          }
      }
  }
  
  protected void UpdateButton_Click(object sender, EventArgs e)
  {
      int id = Convert.ToInt32(Request.QueryString["id"]);
      var updatequery1 = dContext.PersonalDetailTables
          .Where(pd =&gt; pd.ID == id).SingleOrDefault();
  
      if (updatequery1 != null)
      {
          updatequery1.FirstName = FirstNameTextBox.Text;
          updatequery1.LastName = LastNameTextBox.Text;
          updatequery1.CellNumber = CellNumberTextBox.Text;
          dContext.SubmitChanges();
      }
  }
  </code></pre>