docs.intersystems.com
Home / Using the InterSystems Native API for .NET / Native API for .NET Quick Reference

Using the InterSystems Native API for .NET
Native API for .NET Quick Reference
Previous section          
InterSystems: The power behind what matters   
Search:  


This is a quick reference for the InterSystems IRIS Native API for .NET, which consists of the following classes in InterSystems.Data.IRISClient.ADO:
Note:
This chapter is intended as a convenience for readers of this book, but it is not the definitive reference for the Native API. For the most complete and up-to-date information, see the online class documentation under Native API for .NET.
Class IRIS
For the most recent information on this class, see the IRIS section of Native API for .NET in the online documentation.
All methods listed in the following sections will throw an exception on encountering any kind of error. Throughout the API, the subscript argument Object[] args is defined as params object[].
Constructor
Instances of class IRIS are created by calling IRIS.CreateIRIS().
CreateIRIS()
Constructor IRIS.CreateIRIS() returns an instance of IRIS that uses the specified IRISConnection.
static IRIS CreateIRIS(IRISConnection conn)
parameters:
See Introduction to Global Arrays for more information and examples.
Method Details
ClassMethodBool()
IRIS.ClassMethodBool() calls a class method, passing 0 or more arguments and returning an instance of bool?.
Nullable<bool> ClassMethodBool(string className, string methodName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
ClassMethodBytes()
IRIS.ClassMethodBytes() calls a class method, passing 0 or more arguments and returning an instance of byte[].
byte[] ClassMethodBytes(string className, string methodName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
ClassMethodDouble()
IRIS.ClassMethodDouble() calls a class method, passing 0 or more arguments and returning an instance of double?.
Nullable<double> ClassMethodDouble(string className, string methodName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
ClassMethodLong()
IRIS.ClassMethodLong() calls a class method, passing 0 or more arguments and returning an instance of long?.
Nullable<long> ClassMethodLong(string className, string methodName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
ClassMethodString()
IRIS.ClassMethodString() calls a class method, passing 0 or more arguments and returning an instance of string.
string ClassMethodString(string className, string methodName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
ClassMethodVoid()
IRIS.ClassMethodVoid() calls a class method with no return value, passing 0 or more arguments.
void ClassMethodVoid(string className, string methodName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
Close()
IRIS.Close() closes the IRIS object.
void Close()
See Introduction to Global Arrays for more information and examples.
FunctionBool()
IRIS.FunctionBool() calls a function, passing 0 or more arguments and returning an instance of bool?.
Nullable<bool> FunctionBool(string functionName, string routineName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
FunctionBytes()
IRIS.FunctionBytes() calls a function, passing 0 or more arguments and returning an instance of byte[].
byte[] FunctionBytes(string functionName, string routineName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
FunctionDouble()
IRIS.FunctionDouble() calls a function, passing 0 or more arguments and returning an instance of double?.
Nullable<double> FunctionDouble(string functionName, string routineName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
FunctionInt()
IRIS.FunctionInt() calls a function, passing 0 or more arguments and returning an instance of long?.
Nullable<long> FunctionInt(string functionName, string routineName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
FunctionString()
IRIS.FunctionString() calls a function, passing 0 or more arguments and returning an instance of string.
string FunctionString(string functionName, string routineName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
GetBool()
IRIS.GetBool() gets the value of the global as a bool? (or null if node does not exist). Returns false if node value is empty string.
Nullable<bool> GetBool(string globalName, Object[] subscripts)
parameters:
GetBytes()
IRIS.GetBytes() gets the value of the global as a byte[] (or null if node does not exist).
byte[] GetBytes(string globalName, Object[] subscripts)
parameters:
GetDateTime()
IRIS.GetDateTime() gets the value of the global as a DateTime? (or null if node does not exist).
Nullable<DateTime> GetDateTime(string globalName, Object[] subscripts)
parameters:
GetDouble()
IRIS.GetDouble() gets the value of the global as a double? (or null if node does not exist). Returns 0.0 if node value is empty string.
Nullable<Double> GetDouble(string globalName, Object[] subscripts)
parameters:
GetInt16()
IRIS.GetInt16() gets the value of the global as an Int16? (or null if node does not exist). Returns 0 if node value is empty string.
Nullable<short> GetInt16(string globalName, Object[] subscripts)
parameters:
GetInt32()
IRIS.GetInt32() gets the value of the global as an Int32? (or null if node does not exist). Returns 0 if node value is empty string.
Nullable<int> GetInt32(string globalName, Object[] subscripts)
parameters:
GetInt64()
IRIS.GetInt64() gets the value of the global as an Int64? (or null if node does not exist). Returns 0 if node value is empty string.
Nullable<long> GetInt64(string globalName, Object[] subscripts)
parameters:
GetIRISIterator()
IRIS.GetIRISIterator() returns an IRISIterator object (see Class IRISIterator) for the specified node with search direction set to FORWARD.
IRISIterator GetIRISIterator(string globalName, Object[] subscripts)
parameters:
See Iterating Over a Set of Child Nodes for more information and examples.
GetIRISReverseIterator()
IRIS.GetIRISReverseIterator() returns an IRISIterator object (see Class IRISIterator) for the specified node with search direction set to BACKWARD.
IRISIterator GetIRISReverseIterator(string globalName, Object[] subscripts)
parameters:
See Iterating Over a Set of Child Nodes for more information and examples.
GetObject()
IRIS.GetObject() gets the value of the global as an Object (or null if node does not exist).
object GetObject(string globalName, Object[] subscripts)
parameters:
GetSingle()
IRIS.GetSingle() gets the value of the global as a Single? (Nullable<float>) or returns null if node does not exist. Returns 0.0 if node value is an empty string.
Nullable<float> GetSingle(string globalName, Object[] subscripts)
parameters:
GetString()
IRIS.GetString() gets the value of the global as a string (or null if node does not exist).
Empty string and null values require some translation. An empty string "" in .NET is translated to the null string character $CHAR(0) in ObjectScript. A null in .NET is translated to the empty string in ObjectScript. This translation is consistent with the way .NET handles these values.
string GetString(string globalName, Object[] subscripts)
parameters:
GetTLevel()
IRIS.GetTLevel() gets the level of the current nested transaction. Returns 1 if there is only a single transaction open. Returns 0 if there are no transactions open. This is equivalent to fetching the value of the $TLEVEL special variable.
Nullable<int> GetTLevel()
See Transactions and Locking for more information and examples.
Increment()
IRIS.Increment() increments the specified global with the passed value. If there is no node at the specified address, a new node is created with value as the value. A null value is interpreted as 0. Returns the new value of the global node.
long Increment(long value, string globalName, Object[] subscripts)
parameters:
See Creating, Updating, and Deleting Nodes for more information and examples.
IsDefined()
IRIS.IsDefined() returns a value indicating whether the specified node exists and if it contains a value.
int IsDefined(string globalName, Object[] subscripts)
parameters:
return values:
See Testing for Child Nodes and Node Values for more information and examples.
Kill()
IRIS.Kill() deletes the global node including any descendants.
void Kill(string globalName, Object[] subscripts)
parameters:
See Creating, Updating, and Deleting Nodes for more information and examples.
Lock()
IRIS.Lock() locks the global, returns true on success. Note that this method performs an incremental Lock and not the implicit Unlock before Lock feature that is also offered in ObjectScript.
bool Lock(string lockMode, int timeout, string globalName, Object[] subscripts)
parameters:
See Transactions and Locking for more information and examples.
Procedure()
IRIS.Procedure() calls a procedure, passing 0 or more arguments.
void Procedure(string procedureName, string routineName, Object[] args)
parameters:
See Calling ObjectScript Methods and Functions for more information and examples.
ReleaseAllLocks()
IRIS.ReleaseAllLocks() releases all locks associated with the session.
void ReleaseAllLocks()
See Transactions and Locking for more information and examples.
Set()
IRIS.Set() sets the current node to a value of a supported datatype (or "" if the value is null). If there is no node at the specified node address, a new node will be created with the specified value. See Creating, Updating, and Deleting Nodes for more information.
void Set([type] value, string globalName, Object[] subscripts)
parameters:
See Creating, Updating, and Deleting Nodes for more information and examples.
Notes on specific datatypes
The following datatypes have some extra features:
TCommit()
IRIS.TCommit() commits the current transaction.
void TCommit()
See Transactions and Locking for more information and examples.
TRollback()
IRIS.TRollback() rolls back all open transactions in the session.
void TRollback()
See Transactions and Locking for more information and examples.
TRollbackOne()
IRIS.TRollbackOne() rolls back the current level transaction only. If this is a nested transaction, any higher-level transactions will not be rolled back.
void TRollbackOne()
See Transactions and Locking for more information and examples.
TStart()
IRIS.TStart() starts/opens a transaction.
void TStart()
See Transactions and Locking for more information and examples.
Unlock()
IRIS.Unlock() unlocks the global. This method performs an incremental Unlock, not the implicit Unlock-before-Lock feature that is also offered in ObjectScript. See Transactions and Locking for more information.
void Unlock(string lockMode, string globalName, Object[] subscripts)
parameters:
See Transactions and Locking for more information and examples.
Class IRISIterator
For the most recent information on this class, see the IRISIterator section of Native API for .NET in the online documentation.
All methods listed in the following sections will throw an exception on encountering any kind of error.
See Finding Nodes in a Global Array for more details and examples.
IRISIterator Constructor
Instances of IRISIterator are created by calling one of the following IRIS methods:
See Iterating Over a Set of Child Nodes for more information and examples.
This class implements required IEnumerator method System.Collections.IEnumerator.GetEnumerator(), which is invoked when the iterator is used in a foreach loop.
Method and Property Details
Property CurrentSubscript
IRISIterator.CurrentSubscript gets the lowest level subscript for the node at the current iterator position. For example, if the iterator points to node ^myGlobal(23,"somenode"), the returned value will be "somenode".
object CurrentSubscript get;
See Iteration in Conditional Loops for more information and examples.
Property Current
IRISIterator.Current gets the value of the node at the current iterator position. In a foreach loop, this value is also assigned to the current loop variable.
object Current get;
See Iteration in Conditional Loops for more information and examples.
MoveNext()
IRISIterator.MoveNext() implements System.Collections.IEnumerator. It returns true if the next value was retrieved, false if there are no more values.
bool MoveNext()
See Iteration in Conditional Loops for more information and examples.
Reset()
IRISIterator.Reset() can be called after completing a foreach loop to reset the iterator to its starting position, allowing it to be used again.
void Reset()
See Iteration in Conditional Loops for more information and examples.
StartFrom()
IRISIterator.StartFrom() sets the iterator's starting position to the specified subscript. The subscript is an arbitrary starting point, and does not have to specify an existing node.
void  StartFrom(Object subscript)
See Iterating Over a Set of Child Nodes for more information and examples.


Previous section          
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-04-10 14:45:55