public static void AddItemExt(MyTable table) { int i = table.Num + 1; if (table.Num < 5) { string tsql = @"UPDATE [Customers] SET num_ext='" + i + "' WHERE Id='" + table.Id + "'"; try { DBCon con = new DBCon(); con.AddExt(tsql); MessageBox.Show("update"); } catch (SqlException ex) { MessageBox.Show(ex.ToString()); } } else { MessageBox.Show("Already use all ext"); } }
public Window1() { InitializeComponent(); DataContext = new MyTable(); }