private void Connect(ICompany company)
            {
                if (company != null && company.Connected)
                {
                    return;
                }

                if (company == null)
                {
                    throw new Exception("SapDiApi company is null - cant connect");
                }

                var connectionValues = new Dictionary <string, string>();

                try
                {
                    _connectionString.Split(";").ToList()
                    .ForEach(str =>
                    {
                        var s = str.Split("=");
                        if (s.Length == 2)
                        {
                            connectionValues.Add(s[0].ToUpper(), s[1]);
                        }
                    });
                    company.CompanyDB = connectionValues["COMPANYDB"];
                    company.Server    = connectionValues["SERVER"];
                    ;
                    company.LicenseServer = connectionValues["LICENSESERVER"];
                    company.SLDServer     = connectionValues["SLDSERVER"];
                    company.DbUserName    = connectionValues["DBUSERNAME"];
                    company.DbPassword    = connectionValues["DBPASSWORD"];
                    company.UserName      = connectionValues["USERNAME"];
                    company.Password      = connectionValues["PASSWORD"];
                    company.DbServerType  = connectionValues["DBSERVERTYPE"].ToUpper() switch
                    {
                        "MSSQL2012" => BoDataServerTypes.dst_MSSQL2012,
                        "MSSQL2014" => BoDataServerTypes.dst_MSSQL2014,
                        "MSSQL2016" => BoDataServerTypes.dst_MSSQL2016,
                        "MSSQL" => BoDataServerTypes.dst_MSSQL,
                        _ => company.DbServerType
                    };
                    company.UseTrusted = connectionValues["USETRUSTED"] == "TRUE";
                }
                catch
                {
                    //don't expose the connection string through an exception
                    throw new Exception("connection string error!");
                }

                var ret    = company.Connect();
                var errMsg = company.GetLastErrorDescription();
                var errNo  = company.GetLastErrorCode();

                if (errNo != 0)
                {
                    var msg = $"DI-API Connect error: ErrorCode {errNo} = {errMsg}";
                    throw new Exception(msg);
                }
            }