public bool CheckConnect(ComboBox cboServer, TextBox txtData) { try { string connectionstring = string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True;", cboServer.Text.Trim(), txtData.Text.Trim()); if (log.CheckConnectData(connectionstring)) { return(true); } else { MessageBox.Show("Kết nối với Dữ Liệu thất bại! Bạn hãy kiểm tra lại Server và Database!", "Thông báo"); return(false); } }catch (Exception ex) { myme.ShowError(ex); return(false); } }