private void btnCreate_Click(object sender, EventArgs e) { TableWriter writer = new TableWriter(); writer.WriterName = tbName.Text.Trim(); db.TableWriters.InsertOnSubmit(writer); try { db.SubmitChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); db.TableWriters.DeleteOnSubmit(writer); } loadData(); }
partial void UpdateTableWriter(TableWriter instance);
partial void DeleteTableWriter(TableWriter instance);
partial void InsertTableWriter(TableWriter instance);