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
stringThe 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.
Make sure the element on which you perform the operation is active. If it is stopped, a ElementNotFoundException will be thrown.
Exceptions
- ArgumentNullException
key
is null.- ArgumentException
key
is empty ("") or white space.- ParameterNotFoundException
The parameter was not found.
- 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
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);
Remarks
Make sure the element on which you perform the operation is active. If it is stopped, an ElementNotFoundException will be thrown.
Exceptions
- ArgumentNullException
key
is null.- ArgumentException
key
is empty ("") or white space.- ParameterNotFoundException
The parameter was not found.
- ElementNotFoundException
The element was not found in the DataMiner System.