private void btSave_Click(object sender, EventArgs e) { int r = dtGridView.CurrentCell.RowIndex; string tempDID = dtGridView.Rows[r].Cells[0].Value.ToString(); district ProvQ = db.districts.Single(x => x.province_id == tempDID); ProvQ.district_id = txtPID.Text; ProvQ.district_name = txtPName.Text; db.SubmitChanges(); }
private void btSave_Click(object sender, EventArgs e) { int r = dtGridView.CurrentCell.RowIndex; string tempCID = dtGridView.Rows[r].Cells[0].Value.ToString(); commune ComQ = db.communes.Single(x => x.commune_id == tempCID); ComQ.district_id = txtDID.Text; ComQ.commune_id = txtCID.Text; ComQ.commune_name = txtCName.Text; ComQ.degree = Convert.ToInt32(txtDegree.Text); db.SubmitChanges(); }