Table of Contents

Class ProviderDataSource

Inheritance
ProviderDataSource
Implements
Inherited Members
Namespace
TabularEditor.TOMWrapper
Assembly
TOMWrapper.dll

Represents a data source that uses a connection string for the connection.

public sealed class ProviderDataSource : DataSource, ICustomTypeDescriptor, INotifyPropertyChanging, ITabularNamedObject, INamedObject, IComparable, IDescriptionObject, IAnnotationObject, IExtendedPropertyObject, ITabularObject, INotifyPropertyChanged, IClonableObject
Extension Methods

Properties

Account

The user account used for impersonation.

public string Account { get; set; }

Property Value

Type Description
string

ConnectionString

A string used to open the connection to the data source.

[TypeConverter(typeof(ConnectionStringConverter))]
public string ConnectionString { get; set; }

Property Value

Type Description
string

ImpersonationMode

Determines how credentials are obtained for an impersonated connection to a data source during data import or refresh.

public ImpersonationMode ImpersonationMode { get; set; }

Property Value

Type Description
ImpersonationMode

IsPowerBIMashup

[Browsable(false)]
public bool IsPowerBIMashup { get; }

Property Value

Type Description
bool

Isolation

Specifies the locking behavior of the SQL statements when executing commands against the data source. Valid values include ReadCommitted (default) which only reads from committed transactions, or Snapshot which can read any statement in a transaction that is transactionally consistent.

public DatasourceIsolation Isolation { get; set; }

Property Value

Type Description
DatasourceIsolation

Location

[Browsable(false)]
public string Location { get; }

Property Value

Type Description
string

MQuery

public string MQuery { get; }

Property Value

Type Description
string

Name

The name of this object. Warning: Changing the name can break formula logic, if Automatic Formula Fix-up is disabled.

public override string Name { get; set; }

Property Value

Type Description
string

Parent

The parent Model of the current Provider Data Source.

public Model Parent { get; }

Property Value

Type Description
Model

Password

The account password.

public string Password { get; set; }

Property Value

Type Description
string

Provider

An optional string that identifies the name of the managed data provider for the data source.

public string Provider { get; set; }

Property Value

Type Description
string

SourceID

public string SourceID { get; }

Property Value

Type Description
string

Timeout

The timeout in seconds for commands executed against the data source.

public int Timeout { get; set; }

Property Value

Type Description
int

Methods

Clone(string)

Creates an exact copy of this ProviderDataSource object.

public ProviderDataSource Clone(string newName = null)

Parameters

Type Name Description
string newName

Returns

Type Description
ProviderDataSource

CreateNew(Model, string)

Creates a new ProviderDataSource and adds it to the parent Model. Also creates the underlying metadataobject and adds it to the TOM tree.

public static ProviderDataSource CreateNew(Model parent, string name = null)

Parameters

Type Name Description
Model parent
string name

Returns

Type Description
ProviderDataSource

Init()

Derived members should override this method to instantiate child objects

protected override void Init()

OnPropertyChanging(string, object, ref bool, ref bool)

Called before a property is changed on an object. Derived classes can control how the change is handled. Throw ArgumentException within this method, to display an error message in the UI.

protected override void OnPropertyChanging(string propertyName, object newValue, ref bool undoable, ref bool cancel)

Parameters

Type Name Description
string propertyName

Name of the changed property.

object newValue

New value assigned to the property.

bool undoable

Return false if automatic undo of the property change is not needed.

bool cancel

Return true if the property change should not apply.

SetPlaceholder(string, string)

Replaces any occurence of the specified "keyword" with the specified "replaceWith", in the ConnectionString property of this data source.

public void SetPlaceholder(string keyword, string replaceWith)

Parameters

Type Name Description
string keyword
string replaceWith