private void btnUpdate_Click(object sender, EventArgs e) { // Declare local variables and objects... int intPosition = objCurrencyManager.Position; teachers te = new teachers(); te.teacherno = int.Parse(txtteacherno.Text.Trim()); te.artcourse = txtartcourse.Text; te.name = txtname.Text.Trim(); te.tel = txttel.Text.Trim(); te.resume = txtresume.Text.Trim(); te.flag = flag; te.photo = photo; te.Update(); // Close the connection... // Fill the DataSet and bind the fields... FillDataSetAndView(); BindFields(); // Set the record position // to the one that you saved... objCurrencyManager.Position = intPosition; // Show the current record position... ShowPosition(); // Display a message that the record was updated... toolStripStatusLabel1.Text = "عملیات ویرایش رکورد با موفقیت انجام شد"; }
private void btnUpdate_Click(object sender, EventArgs e) { teachers te = new teachers(); te.teacherno = int.Parse(txtteacherno.Text.Trim()); te.name = txtname.Text.Trim(); te.artcourse = txtartcourse.Text; te.tel = txttel.Text.Trim(); te.resume = txtresume.Text.Trim(); te.flag = flag; te.photo = photo; te.Update(); this.Close(); }