private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Debug.WriteLine(conDB.pathFileDB); FRMSettingConDB settingDB = new FRMSettingConDB(conDB.pathFileDB); settingDB.ShowDialog(); }
private void Initialize() { ReadFileConDB readFile = new ReadFileConDB(); bool resultCheckReadFile = readFile.readFileConDB(pathFileDB); if (!resultCheckReadFile) { MessageBox.Show("ไม่พบไฟล์ที่ใช้เชื่อมต่อฐานข้อมูล"); FRMSettingConDB settingDB = new FRMSettingConDB(pathFileDB); settingDB.ShowDialog(); return; } userName = readFile.userName; password = readFile.pwd; server = readFile.hostName; dataBaseName = readFile.dataBaseName; port = readFile.port; string connectionString = "SERVER=" + server + ";" + "DATABASE=" + dataBaseName + ";" + "UID=" + userName + ";" + "PASSWORD="******";Charset=utf8;"; connection = new MySqlConnection(connectionString); CheckConnect(); CloseConnection(); //throw new NotImplementedException(); }