private DbConnection OpenConnection(Sage50ImportDetails importDetails, Sage50Driver sage50Driver)
        {
            var connectionString = CreateConnectionString(importDetails, sage50Driver);
            var conn             = new OdbcConnection(connectionString);

            OpenConnection(conn);
            return(conn);
        }
 private static Sage50Driver CreateDriver(string name)
 {
     try
     {
         return(Sage50Driver.Create(name));
     }
     catch (FormatException)
     {
         return(null);
     }
 }
Example #3
0
 protected bool Equals(Sage50Driver other)
 {
     return(Version == other.Version && string.Equals(Name, other.Name) && string.Equals(FriendlyName, other.FriendlyName));
 }
        private static string CreateConnectionString(Sage50ImportDetails importDetails, Sage50Driver driver)
        {
            var builder = new OdbcConnectionStringBuilder
            {
                Driver = driver.Name
            };

            builder["uid"] = importDetails.Username;
            builder["dir"] = importDetails.DataDirectory;

            if (!string.IsNullOrEmpty(importDetails.Password))
            {
                builder["pwd"] = importDetails.Password;
            }

            var connectionString = builder.ConnectionString;

            return(connectionString);
        }