title: Doesn't parse updated row from LinqToSQLDataClass to Database LINQ C# WPF
body: <p>I'm building an Edit/Update system in my program using Linq in C# WPF.
  My problem is that my code does submit to the LinqToSQLDatacontex but doesn't parse it through to  the actual Database. </p>
  
  <p>The result of that is that the datarow is updated in Runtime but in fact isn't updated in the actual Database.</p>
  
  <p>this is the code I use for Updating my rows.</p>
  
  <pre><code>private void dgUsers_MouseUp(object sender, MouseButtonEventArgs e)
      {
          try
          {
              item = dgUsers.SelectedItem;
              this.name = (dgUsers.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text;
  
              var query =
                  from t in db.tbl_Users
                  where t.Name == name
                  select t;
  
              foreach (var q in query)
              {
                  tbMoreName.Text = q.Name;
                  tbMoreRights.Text = q.Rights;
                  tbMoreTag.Text = q.Operatortag;
                  checkMoreActive.IsChecked = q.Active;
                  tbMoreCardCode.Text = q.CardCode;
              }
  
              var table =
                  from q in db.tbl_UserProfiles
                  where q.Userprofile == tbMoreRights.Text
                  select q;
          }
          catch (Exception exc)
          {
              MessageBox.Show("NOPE");
          }
      }
  
   private void btnSaveUser_Click(object sender, RoutedEventArgs e)
      {
          switch (saveType)
          {
  
  
              case "Edit":
                  #region save Edit User
  
                  var edit =
                      (from t in db.tbl_Users
                       where t.Name == name
                       select t).First();
  
                  MessageBox.Show(edit.Id.ToString() + " " + edit.Name.ToString() + " " + edit.Operatortag.ToString() + " " + edit.Rights.ToString() + " " + edit.Active.ToString());
  
                  edit.Id = edit.Id;
                  edit.Name = tbName.Text;
                  edit.Operatortag = tbOperatortag.Text;
                  edit.Rights = cbRights.Text;
                  edit.Active = checkActive.IsChecked.Value;
                  edit.CardCode = tbCardcode.Text;
  
                  MessageBox.Show(edit.Id.ToString() + " " + edit.Name.ToString() + " " + edit.Operatortag.ToString() + " " + edit.Rights.ToString() + " " + edit.Active.ToString() + " " + edit.CardCode.ToString());
  
                  db.SubmitChanges();
  
                  #endregion
                  saveType = "";
                  break;
          }
          var refresh =
                      (from q in db.tbl_Users
                       select new { Name = q.Name, Rights = q.Rights, Operatortag = q.Operatortag, Active = q.Active, Cardcode = q.CardCode }).ToList();
  
          dgUsers.ItemsSource = null;
          dgUsers.ItemsSource = refresh;
          MessageBox.Show(refresh[0].ToString() + " " + refresh[1].ToString() + " " + refresh[2].ToString() + " " + refresh[3].ToString() + " " + refresh[4].ToString());
      }
  </code></pre>
  
  <p>I hope that one of you guys can help me.
  Thanks in advance!!!</p>