All the public classes in the OpenLink.Data namespace are detailed in this section. Note that all of the OpenLink .Net Data Providers use the same common class names, thus the descriptions below are applicable to all enabling maximum re-use of code across Providers.
IMPORTANT: Public class members inherited from a base class defined by the .NET Framework Class Library (FCL), or which implement an FCL defined interface method, are not described. For details of these inherited members, refer to the .NET FCL documentation for the base class or interface. Where an OpenLink class implements an ADO.NET interface and adds additional methods or properties, these extensions are documented.
In the class descriptions which follow, all code extracts showing partial class definitions, method signatures etc. are in C#. Examples for other .NET languages are not shown.
Represents an SQL statement or stored procedure to execute against a database.
public class OPLCommand : Component, IDbCommand, ICloneable
public OPLCommand ();
Initializes a new instance of the OPLCommand class.
public OPLCommand (string cmdText);
Initializes a new instance of the OPLCommand class with the text of the query.
public OPLCommand (string cmdText, OPLConnection connection);
Initializes a new instance of the OPLCommand class with the text of the query and an OPLConnection object.
public OPLCommand (string cmdText, OPLConnection connection,OPLTransaction txn);
Initializes a new instance of the OPLCommand class with the text of the query, an OPLConnection object and an OPLTransaction object.
public bool PassThrough {get; set;}
Allows the command text to be passed to the data source without being parsed by the Generic Provider.
The PassThrough property defaults to false. When pass-through is disabled, the Generic Provider parses command text associated with the OPLCommand and queries the data source for additional metadata on tables referenced in a select statement. The command parser in the Generic Provider is limited to the SQL grammar defined by ODBC. If you wish to pass native SQL to the data source you should enable pass-through; however this will have the following side-effects:
Automatically generates single-table commands used to reconcile changes made to a DataSet with the associated data source.
public sealed class OPLCommandBuilder : Component
public OPLCommandBuilder ();
Initializes a new instance of the OPLCommandBuilder class.
public OPLCommandBuilder (OPLDataAdapter adapter);
Initializes a new instance of the OPLCommandBuilder class with the associated OPLDataAdapter object.
public static void DeriveParameters (OPLCommand command);
Retrieves parameter information from the stored procedure specified in the OPLCommand and populates the Parameters collection of the specified OPLCommand object.
protected override void Dispose (bool disposing);
Releases the resources used by the OPLCommandBuilder.
public OPLCommand GetDeleteCommand ();
Gets the automatically generated OPLCommand object required to perform deletions at the data source.
public OPLCommand GetInsertCommand ();
Gets the automatically generated OPLCommand object required to perform insertions at the data source.
public OPLCommand GetUpdateCommand ();
Gets the automatically generated OPLCommand object required to perform updates at the data source.
public void RefreshSchema ();
Refreshes the database schema information used to generate INSERT, UPDATE, or DELETE statements.
public OPLDataAdapter DataAdapter {get; set;}
Gets or sets an OPLDataAdapter object for which this OPLCommandBuilder object will generate SQL statements.
public string QuotePrefix {get; set;}
Gets or sets the beginning character or characters to use when working with database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens.
public string QuoteSuffix {get; set;}
Gets or sets the ending character or characters to use when working with database objects, (for example, tables or columns), whose names contain characters such as spaces or reserved tokens.
Represents an open connection to a data source.
public sealed class OPLConnection : Component, ICloneable, IDbConnection
public OPLConnection();
Initializes a new instance of the OPLConnect class.
public OPLConnection(string connectionString);
Initializes a new instance of the OPLConnection class with the specified connection string.
protected override void Dispose (bool disposing);
Releases the resources used by the OPLConnection.
public event StateChangeEventHandler StateChange;
Occurs when the state of the connection changes.
The StateChange event is raised immediately after the State changes from Closed to Opened, or from Opened to Closed.
public event OPLInfoMessageEventHandler InfoMessage;
Returns warning messages from the DBMS.
public delegate void OPLInfoMessageEventHandler (object sender, OPLInfoMessageEventArgs e)
class OPLInfoMessageEventArgs;
Represents a set of data commands and a database connection that are used to fill a DataSet and update a data source.
public OPLDataAdapter();
Initializes a new instance of the OPLDataAdapter class.
public OPLDataAdapter (OPLCommand selectCommand);
Initializes a new instance of the OPLDataAdapter class with the specified SQL SELECT statement.
public OPLDataAdapter (string selectCommandText, OPLConnection selectConnection);
Initializes a new instance of the OPLDataAdapter class with an SQL SELECT statement and an OPLConnection.
public OPLDataAdapter (string selectCommandText, string selectConnectionString);
Initializes a new instance of the OPLDataAdapter class with an SQL SELECT statement and a connection string.
public event OPLRowUpdatedEventHandler RowUpdated;
Occurs during an Update operation after a command is executed against the data source.
public event OPLRowUpdatingEventHandler RowUpdating;
Occurs during an Update operation before a command is executed against the data source.
Provides a way of reading a forward-only stream of data rows from a data source.
public sealed class OPLDataReader : MarshalByRefObject, IDataReader, IDataRecord, IDisposable, IEnumerable
Holds information about a warning or error returned by a data source.
public sealed class OPLError
This class is created whenever an error occurs. Each instance of OPLError created is then managed by the OPLErrorCollection class, which in turn is created by the OPLException class.
public string Message {get;}
Gets a short description of the error.
public string SQLState {get;}
Gets the five character ODBC SQL state associated with the error.
public int NativeError {get;}
Gets the data source-specific error information.
Represents a collection of one or more OPLError objects that give detailed information about an OPLException.
public sealed class OPLErrorCollection : ICollection
This class is created by OPLException to collect instances of the OPLError class. OPLErrorCollection always contains at least one instance of the OPLError class.
public IEnumerator GetEnumerator();
This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
public OPLError this[int i] {get;}
Gets the error at the specified index. In C#, this property is the indexer for the OPLErrorCollection class.
The exception that is generated when a warning or error is returned by a data source or the Generic Provider.
public sealed class OPLException : SystemException
public OPLErrorCollection Errors {get;}
Gets a collection of one or more OPLError objects that give detailed information about the exception.
public override string Message {get;}
Gets the text describing the error.
Represents a parameter to an OPLCommand and optionally, its mapping to a DataSet column.
public class OPLParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
public OPLParameter();
Initializes a new instance of the OPLParameter class.
public OPLParameter(string parameterName, object value);
Initializes a new instance of the OPLParameter class with the parameter name and a value of the new OPLParameter object.
public OPLParameter(string parameterName, OPLDbType type);
Initializes a new instance of the OPLParameter class with the parameter name and the data type.
public OPLParameter(string parameterName, OPLDbType type, int size);
Initializes a new instance of the OPLParameter class with the parameter name, the OPLDbType and the size.
public OPLParameter(string parameterName, OPLDbType type, int size, string sourceColumn);
Initializes a new instance of the OPLParameter class with the parameter name, the OPLDbType, the size, and the source column name.
public OPLParameter(string parameterName, OPLDbType type, int size, ParameterDirection direction, Boolean isNullable, Byte precision, Byte scale, string sourceColumn, DataRowVersion sourceVersion, object value);
Initializes a new instance of the OPLParameter class with the parameter name, the type of the parameter, the size of the parameter, a ParameterDirection, whether the parameter is nullable, the precision of the parameter, the scale of the parameter, the source column, a DataRowVersion to use, and the value of the parameter.
public override string ToString ();
Gets a string containing the ParameterName.
public OPLDbType OPLDbType {get; set;}
Gets or sets the OPLDbType of the parameter.
The OPLDbType and DbType are linked. Therefore, setting the DbType changes the OPLType to a supporting OPLDbType. For a list of the supported data types, see the appropriate OPLDbType member.
Represents a collection of parameters relevant to an OPLCommand as well as their respective mappings to columns in a DataSet.
public class OPLParameterCollection : MarshalByRefObject, IDataParameterCollection, ICollection, IEnumerable, IList
public int Add (OPLParameter value);
Adds the specified OPLParameter to the OPLParameterCollection
public int Add (string parameterName, object value);
Adds an OPLParameter to the OPLParameterCollection given the parameter name and value.
public int Add (string parameterName, OPLDbType dbType);
Adds an OPLParameter to the OPLParameterCollection given the parameter name and data type.
public int Add (string parameterName, OPLDbType dbType, int size);
Adds an OPLParameter to the OPLParameterCollection given the the parameter name, data type, and column length.
public int Add (string parameterName, OPLDbType dbType, int size, string sourceColumn);
Adds an OPLParameter to the OPLParameterCollection given the parameter name, data type, column length, and source column name.
public OPLParameter this[int index] {get; set;}
Gets or sets the OPLParameter at the specified index
public OPLParameter this[string parameterName] {get; set;}
Gets or sets the OPLParameter with the specified name.
Provides data for the OPLDataAdapter.RowUpdated event.
public OPLRowUpdatedEventArgs(DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping);
Initializes a new instance of the OPLRowUpdatedEventArgs class.
public new OPLCommand Command {get;}
Gets the OPLCommand executed when Update is called.
Represents a method that will handle the RowUpdated event of an OPLDataAdapter.
public delegate void OPLRowUpdatedEventHandler(object sender, OPLRowUpdatedEventArgs e);
Provides data for the OPLDataAdapter.RowUpdating event.
public OPLRowUpdatingEventArgs(DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping);
Initializes a new instance of the OPLRowUpdatingEventArgs class.
public new OPLCommand Command {get; set;}
Gets or sets the OPLCommand to execute when Update is called.
Represents a method that will handle the RowUpdating event of an OPLDataAdapter.
public delegate void OPLRowUpdatingEventHandler(object sender, OPLRowUpdatingEventArgs e);
Represents an SQL transaction to be made at a data source.
public sealed class OPLTransaction : MarshalByRefObject, IDbTransaction, IDisposable
|
Previous
OpenLink .NET Data Providers Class Implementation |
Chapter Contents |
Next
Known Issues |