public class NativeOracleObject : NativeOracleObjectBase, System.IDisposable
'Declaration Public Class NativeOracleObject Inherits NativeOracleObjectBase Implements System.IDisposable
This class is a wrapper around OCI objects, and is intended for use in connected data access model. To retrieve values of object attributes the NativeOracleObject class uses Item indexed property.
You can create an instance of NativeOracleObject by one of the following ways:
- execute a query that returns an object as one of the fields calling OracleDataReader.GetNativeOracleObject method;
- return an NativeOracleObject instance as a parameter value of OracleDbType.Object type;
- get object reference (OracleRef), call OracleRef.Pin method and get NativeOracleObject by calling OracleRef.GetObject method;
- get the NativeOracleObject as a value of owned NativeOracleObject attribute.
Also you can create an instance of NativeOracleObject manually.
You can use NativeOracleObject to pass object as a parameter value and post updated data to the server using NativeOracleObjectBase.Flush method for the pinned object received by OracleRef.
Note that NativeOracleObject can be used in data binding with DataGrid as it implements IListSource interface.
This class is not available in OracleConnection.Direct mode.
This example demonstrates how to retrieve a NativeOracleObject instance from the server and display its elements. To create required type and table and fill it with data you can use the following script:
CREATE TYPE TAddress AS OBJECT ( Country VARCHAR2(30), City VARCHAR2(30), Street VARCHAR2(30), Apartment NUMBER ); CREATE TABLE EmpObject ( Code NUMBER PRIMARY KEY, Person VARCHAR2(40), Address TAddress, Job VARCHAR2(9) ); INSERT INTO EmpObject (Code, Person, Address, Job) VALUES (1, 'SMITH', TAddress('UK', 'London', 'Street', 12), 'CLERK'); INSERT INTO EmpObject (Code, Person, Address, Job) VALUES (2, 'JONES', TAddress('USA', 'New York', 'Street', 418), 'MANAGER'); INSERT INTO EmpObject (Code, Person, Address, Job) VALUES (3, 'SCOTT', TAddress('CANADA', 'Ottawa', 'Street', 26),'PRESIDENT'); INSERT INTO EmpObject (Code, Person, Address, Job) VALUES (4, 'MARTIN', TAddress('FRANCE', 'Paris', 'Street', 162), 'ANALYST');
System.Object
System.MarshalByRefObject
Devart.Data.Oracle.NativeOracleObjectBase
Devart.Data.Oracle.NativeOracleObject
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2