Example #1
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (MyDatabaseContext != null)
     {
         MyDatabaseContext.Dispose();
         MyDatabaseContext = null;
     }
 }
Example #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            PageSize  = 10;
            PageIndex = 1;

            try
            {
                MyDatabaseContext =
                    new Models.DataBaseContext();

                DisplayCountries();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
            }
        }