Class ExternalConnection

Class ExternalConnection

Namespace: Aspose.Cells.ExternalConnections
Assembly: Aspose.Cells.dll (25.2.0)

Specifies an external data connection

public abstract class ExternalConnection

Inheritance

objectExternalConnection

Derived

DBConnection, DataModelConnection, WebQueryConnection

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties

BackgroundRefresh

Indicates whether the connection can be refreshed in the background (asynchronously). true if preferred usage of the connection is to refresh asynchronously in the background; false if preferred usage of the connection is to refresh synchronously in the foreground.

public bool BackgroundRefresh { get; set; }

Property Value

bool

ClassType

Gets the type of this Aspose.Cells.ExternalConnections.ExternalConnection object.

public abstract ExternalConnectionClassType ClassType { get; }

Property Value

ExternalConnectionClassType

Command

The string containing the database command to pass to the data provider API that will interact with the external source in order to retrieve data

public virtual string Command { get; set; }

Property Value

string

CommandType

Specifies the OLE DB command type.

  1. Query specifies a cube name
  2. Query specifies a SQL statement
  3. Query specifies a table name
  4. Query specifies that default information has been given, and it is up to the provider how to interpret.
  5. Query is against a web based List Data Provider.
public virtual OLEDBCommandType CommandType { get; set; }

Property Value

OLEDBCommandType

ConnectionDescription

Specifies the user description for this connection

public string ConnectionDescription { get; set; }

Property Value

string

ConnectionFile

Gets the connection file.

public virtual string ConnectionFile { get; }

Property Value

string

ConnectionString

The connection information string is used to make contact with an OLE DB or ODBC data source.

public virtual string ConnectionString { get; set; }

Property Value

string

CredentialsMethodType

Specifies the authentication method to be used when establishing (or re-establishing) the connection.

public CredentialsMethodType CredentialsMethodType { get; set; }

Property Value

CredentialsMethodType

Id

Gets the id of the connection.

public int Id { get; }

Property Value

int

IsDeleted

Indicates whether the associated workbook connection has been deleted. true if the connection has been deleted; otherwise, false.

public bool IsDeleted { get; set; }

Property Value

bool

IsNew

True if the connection has not been refreshed for the first time; otherwise, false. This state can happen when the user saves the file before a query has finished returning.

public bool IsNew { get; set; }

Property Value

bool

KeepAlive

True when the spreadsheet application should make efforts to keep the connection open. When false, the application should close the connection after retrieving the information.

public bool KeepAlive { get; set; }

Property Value

bool

Name

Specifies the name of the connection. Each connection must have a unique name.

public string Name { get; set; }

Property Value

string

OdcFile

Specifies the full path to external connection file from which this connection was created. If a connection fails during an attempt to refresh data, and reconnectionMethod=1, then the spreadsheet application will try again using information from the external connection file instead of the connection object embedded within the workbook.

public string OdcFile { get; set; }

Property Value

string

OnlyUseConnectionFile

Indicates whether the spreadsheet application should always and only use the connection information in the external connection file indicated by the odcFile attribute when the connection is refreshed. If false, then the spreadsheet application should follow the procedure indicated by the reconnectionMethod attribute

public bool OnlyUseConnectionFile { get; set; }

Property Value

bool

Parameters

Gets Aspose.Cells.ExternalConnections.ConnectionParameterCollection for an ODBC or web query.

public ConnectionParameterCollection Parameters { get; }

Property Value

ConnectionParameterCollection

PowerQueryFormula

Gets the definition of power query formula.

public virtual PowerQueryFormula PowerQueryFormula { get; }

Property Value

PowerQueryFormula

ReconnectionMethodType

Specifies what the spreadsheet application should do when a connection fails. The default value is ReConnectionMethodType.Required.

public ReConnectionMethodType ReconnectionMethodType { get; set; }

Property Value

ReConnectionMethodType

RefreshInternal

Specifies the number of minutes between automatic refreshes of the connection.

public int RefreshInternal { get; set; }

Property Value

int

RefreshOnLoad

True if this connection should be refreshed when opening the file; otherwise, false.

public bool RefreshOnLoad { get; set; }

Property Value

bool

SSOId

Identifier for Single Sign On (SSO) used for authentication between an intermediate spreadsheetML server and the external data source.

public string SSOId { get; set; }

Property Value

string

SaveData

True if the external data fetched over the connection to populate a table is to be saved with the workbook; otherwise, false.

public bool SaveData { get; set; }

Property Value

bool

SavePassword

True if the password is to be saved as part of the connection string; otherwise, False.

public bool SavePassword { get; set; }

Property Value

bool

SecondCommand

Specifies a second command text string that is persisted when PivotTable server-based page fields are in use. For ODBC connections, serverCommand is usually a broader query than command (no WHERE clause is present in the former). Based on these 2 commands(Command and ServerCommand), parameter UI can be populated and parameterized queries can be constructed

public virtual string SecondCommand { get; set; }

Property Value

string

SourceFile

Used when the external data source is file-based. When a connection to such a data source fails, the spreadsheet application attempts to connect directly to this file. May be expressed in URI or system-specific file path notation.

public string SourceFile { get; set; }

Property Value

string

SourceType

Gets or Sets the external connection DataSource type.

public ConnectionDataSourceType SourceType { get; set; }

Property Value

ConnectionDataSourceType