public SuposDbProvider(DbSettings config) { string constr = "factory="; switch(config.DbType) { case "SQLite" : constr += "Sqlite;"; constr += "Data Source="; constr += config.Database; break; case "PostgreSQL" : constr += "Npgsql;"; constr += "Server="; constr += config.Server; constr += ";Port="; constr += config.Port; constr += ";User ID="; constr += config.User; constr += ";Password="******";Database="; constr += config.Database; break; default : break; } connection = ProviderFactory.CreateConnection(constr); CreateAdapters(); }
public void LoadSettings( DbSettings config) { TypeComboSetActive( config.DbType ); serverEntry.Text = config.Server; portSpinButton.Value = config.Port; userEntry.Text = config.User; passEntry.Text = config.Password; dbEntry.Text = config.Database; mediaButton.SetCurrentFolder( config.MediaPath ); }
public void ApplySettings(DbSettings config) { config.DbType = typeCombo.ActiveText; config.Server = serverEntry.Text; config.Port = portSpinButton.ValueAsInt; config.User = userEntry.Text; config.Password = passEntry.Text; config.Database = dbEntry.Text; config.MediaPath = mediaButton.CurrentFolder; }
public void ApplyDatabaseSettings(DbSettings config) { dbForm.ApplySettings(config); }
public void LoadDatabaseSettings(DbSettings config) { dbForm.LoadSettings(config); }
public SuposDb( DbSettings config ) { settings = config; ds = new SuposDataSet(); provider = new SuposDbProvider(config); }