private AdventureWorks2019DataSet.CurrencyRow GetSelectedRow() { String SelectedCurrencyCode = dataGridView1.CurrentRow.Cells["CurrencyCode"].Value.ToString(); AdventureWorks2019DataSet.CurrencyRow SelectedRow = adventureWorks2019DataSet1.Currency.FindByCurrencyCode(SelectedCurrencyCode); return(SelectedRow); }
private void AddRowButton_Click(object sender, EventArgs e) { AdventureWorks2019DataSet.CurrencyRow NewRow = (AdventureWorks2019DataSet.CurrencyRow)adventureWorks2019DataSet1.Currency.NewRow(); NewRow.CurrencyCode = "WINGT"; NewRow.Name = "Wingtip Toys"; try { adventureWorks2019DataSet1.Currency.Rows.Add(NewRow); } catch (Exception ex) { MessageBox.Show(ex.Message, "Add Row Failed"); } }