OPC Studio User's Guide and Reference
TryValidate Method (UnionData)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.DataTypeModel Namespace > UnionData Class : TryValidate Method
Attempts to validate the current data. The associated data type, if present, is used for validation.
Syntax
'Declaration
 
Public Overrides NotOverridable Function TryValidate() As Exception
'Usage
 
Dim instance As UnionData
Dim value As Exception
 
value = instance.TryValidate()
public override Exception TryValidate()
public:
Exception^ TryValidate(); override 

Return Value

Returns a non-null System.Exception if the validation fails; returns a null reference otherwise.

This method can return null (Nothing in Visual Basic).

Remarks

The field, if specified, must be present in the data fields.

The specified field must not be optional, and it must be neither a length field nor a switch field.

If the field is specified, the field value must not be null, and it must be valid. If the field is not specified, the field value must be null.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also