public void GetDatabasePath() { DialogResult dr = new DialogResult(); DatabasePath dataBasePath = new DatabasePath(); dr = dataBasePath.ShowDialog(); if (dr == DialogResult.OK) { path = dataBasePath.DataFilePath; Variables.accountName = Path.GetFileNameWithoutExtension(path); SetDatabasePath(); this.Close(); } }