Table of Contents

Method GetValue

Namespace
Skyline.DataMiner.Core.DataMinerSystem.Common
Assembly
Skyline.DataMiner.Core.DataMinerSystem.Common.dll

GetValue(string)

Gets the value of the cell that corresponds with the specified key.

[Obsolete("Use the overload with the additional KeyType argument instead.")]
T GetValue(string key)

Parameters

key string

The key of the row.

Returns

T

The cell value.

Examples

IDms myDms = protocol.GetDms();
IDmsElement element = myDms.GetElement(new DmsElementId(346, 100));
var table = element.GetTable(1000);
var column = table.GetColumn<double?>(1004);

string displayKey = "DK 1";
var value = column.GetValue(displayKey);

Remarks

The key is assumed to be the display key. If no display key was found with the specified value, but a row exists with a primary key with the specified value, then the value of that row will be returned (only the case when the naming option or NamingFormat is in the protocol XML is used, not for the deprecated displayColumn attribute).

Do not use this call with primary keys in case the primary key value is also used as display key of another row.

This overload is deprecated. Use the overload with the additional KeyType argument instead.

Exceptions

ArgumentNullException

key is null.

ArgumentException

key is empty ("") or white space.

ParameterNotFoundException

The parameter was not found.

ElementStoppedException

The element is stopped.

ElementNotFoundException

The element was not found in the DataMiner System.

GetValue(string, KeyType)

Gets the value of the cell that corresponds with the specified key.

T GetValue(string key, KeyType keyType)

Parameters

key string

The key of the row.

keyType KeyType

The key type.

Returns

T

The cell value.

Examples

IDms myDms = protocol.GetDms();
IDmsElement element = myDms.GetElement(new DmsElementId(346, 100));
var table = element.GetTable(1000);
var column = table.GetColumn<double?>(1004);

string primaryKey = "PK 1";
var value = column.GetValue(primaryKey, KeyType.PrimaryKey);

Exceptions

ArgumentNullException

key is null.

ArgumentException

key is empty ("") or white space.

ParameterNotFoundException

The parameter was not found.

ElementStoppedException

The element is stopped.

ElementNotFoundException

The element was not found in the DataMiner System.