Table of Contents

Class DbConnections

Namespace
Tripous.Data
Assembly
Tripous.Data.dll

A container of DbConnectionInfo objects.

This object is saved to a JSON file.

public class DbConnections : SettingsBase
Inheritance
DbConnections
Inherited Members
Extension Methods

Constructors

DbConnections()

Constructor.

public DbConnections()

Properties

FileName

Gets the file name used for persistence.

protected override string FileName { get; }

Property Value

string

List

Gets or sets the list of connection definitions.

public ObservableCollection<DbConnectionInfo> List { get; set; }

Property Value

ObservableCollection<DbConnectionInfo>

Methods

Add(string, DbServerType, string, int)

Creates and adds a connection definition.

public DbConnectionInfo Add(string Name, DbServerType dbServerType, string ConnectionString, int CommandTimeoutSeconds)

Parameters

Name string
dbServerType DbServerType
ConnectionString string
CommandTimeoutSeconds int

Returns

DbConnectionInfo

Add(DbConnectionInfo)

Adds a connection definition if it does not already exist.

public DbConnectionInfo Add(DbConnectionInfo Item)

Parameters

Item DbConnectionInfo

Returns

DbConnectionInfo

Contains(string)

Returns true if a connection with the specified name exists.

public bool Contains(string Name)

Parameters

Name string

Returns

bool

Find(string)

Finds a connection by name.

public DbConnectionInfo Find(string Name)

Parameters

Name string

Returns

DbConnectionInfo

Get(string)

Returns a connection by name or raises an exception when not found.

public DbConnectionInfo Get(string Name)

Parameters

Name string

Returns

DbConnectionInfo

LoadBefore()

Clears the current list before loading from storage.

protected override void LoadBefore()

Remove(string)

Removes a connection definition by name.

public bool Remove(string Name)

Parameters

Name string

Returns

bool

Remove(DbConnectionInfo)

Removes a connection definition.

public bool Remove(DbConnectionInfo Item)

Parameters

Item DbConnectionInfo

Returns

bool