private void SaveButton_Click_1(object sender, EventArgs e) { try { dataTable1BindingSource1.EndEdit(); App.DataTable1.WriteXml(string.Format("{0}//data.dat", Application.StartupPath)); MessageBox.Show("Save Complete"); groupBox3.Enabled = false; grpBxReportedBy.Enabled = false; groupBox1.Enabled = false; App.DataTable1.AcceptChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Messages", MessageBoxButtons.OK, MessageBoxIcon.Error); App.DataTable1.RejectChanges(); } } static DataSet1 db; protected static DataSet1 App { get { if (db == null) db = new DataSet1(); return db; } } private void FascilitiesMaint2018_Load(object sender, EventArgs e) { string fileName = string.Format("{0}//data.dat", Application.StartupPath); if (File.Exists(fileName)) { App.DataTable1.ReadXml(fileName); } dataTable1BindingSource1.DataSource = App.DataTable1; groupBox3.Enabled = false; grpBxReportedBy.Enabled = false; groupBox1.Enabled = false; }
string.Format("{0}//data.dat", Application.StartupPath)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)