The following table maps the native Ingres database types supported by the Ingres .NET Data Provider to their corresponding .NET type. It also maps the typed accessor that a .NET application uses for an Ingres native database type to be obtained as a .NET type.
IngresType |
Ingres Data Type |
.NET Data Type |
Accessor |
---|---|---|---|
Binary |
byte |
Byte[] |
GetBytes() |
Char |
char |
String |
GetString() |
DateTime |
date |
DateTime |
GetDateTime() |
Decimal |
decimal |
Decimal |
GetDecimal() |
Double |
double precision |
Double |
GetDouble() |
SmallInt |
smallint |
Int16 |
GetInt16() |
TinyInt |
integer1 |
Byte |
GetByte() |
Int |
integer |
Int32 |
GetInt32() |
BigInt |
bigint |
Int64 |
GetInt64() |
LongVarBinary |
long byte |
Byte[] |
GetBytes() |
LongVarChar |
long varchar |
String |
GetString() |
LongNVarChar |
long nvarchar |
String |
GetString() |
Nchar |
nchar |
String |
GetString() |
NvarChar |
nvarchar |
String |
GetString() |
Real |
real (float4) |
Single |
GetString() |
VarBinary |
byte varying |
Byte[] |
GetBytes() |
VarChar |
varchar |
String |
GetString() |
The IngresDataAdapter class represents a set of SQL statements and a database connection that are used to fill a DataSet and, optionally, update the Ingres database. The IngresDataAdapter object acts as a bridge between a .NET DataSet and the Ingres database for retrieving and updating data.
The declarations for the IngresDataAdapter class are:
C#: public sealed class IngresDataAdapter : DbDataAdapter, IDbDataAdapter, ICloneable
VB.NET: NotInheritable Public Class DataAdapter
Inherits DbDataAdapter
Implements IDbDataAdapter, ICloneable
public DataSet CreateDataSet(
string dsName, string connectionString, string commandText)
{
IngresConnection connection =
new IngresConnection(connectionString);
IngresCommand command =
new IngresCommand(commandText, connection);
IngresDataAdapter adapter = new IngresDataAdapter(command);
DataSet ds = new DataSet();
adapter.Fill(ds, dsName);
return ds;
}
The IngresDataAdapter class has the following properties:
Property |
Accessor |
Description |
---|---|---|
AcceptChangesDuringFill |
get set |
A true/false value indicating whether the DataRow.AcceptChanges method is called after the DataRow is added to the DataTable. Inherited from DataAdapter. Default is true. |
ContinueUpdateOnError |
get set |
A true/false value indicating whether to generate an exception or to update the RowError property when an error occurs during an update to the row. Inherited from DataAdapter. Default is false. |
DeleteCommand |
get set |
Command to be used (SQL statement or database procedure) to DELETE records from the database. |
InsertCommand |
get set |
Command to be used (SQL statement or database procedure) to INSERT records into the database. |
MissingMappingAction |
get set |
Action to be taken if incoming data does not have a matching table or column. Default is Passthrough. Inherited from DataAdapter. |
MissingSchemaAction |
get set |
Action to be taken if an existing DataSet schema does not match incoming data. Default is Add. Inherited from DataAdapter. |
SelectCommand |
get set |
Command to be used (SQL statement or database procedure) to SELECT records from the database. |
TableMappings |
get |
The collection that provides the mapping between the returned records and the DataSet. Default is an empty collection. Inherited from DataAdapter. |
UpdateCommand |
get set |
Command to be used (SQL statement or database procedure) to UPDATE records in the database. |
The public methods available to the IngresDataAdapter Class are:
Method |
Description |
---|---|
Dispose |
Releases allocated resources. |
Fill |
Adds or refreshes rows in the DataSet to match the values in the database. Inherited from DBDataAdapter. |
FillSchema |
Adds a DataTable to a DataSet and configures the schema to match that in the database. FillSchema does not add rows to a DataTable. Inherited from DBDataAdapter. |
GetFillParameters |
Gets an array of IDataParameter objects that contain the parameters set by the user when executing a SELECT statement. Inherited from DBDataAdapter. |
Update |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet. Inherited from DBDataAdapter. |
The events generated by the IngresDataAdapter class are:
Event |
Description |
---|---|
FillError |
Raised when an error occurs during a Fill operation. Inherited from DBDataAdapter. |
RowUpdating |
Raised as an UPDATE, INSERT, or DELETE operation on a row (by a call to one of the Update methods) is about to start. |
RowUpdated |
Raised after an UPDATE, INSERT, or DELETE operation on a row (by a call to one of the Update methods) is complete. |
The IngresDataAdapter class contains the following constructors:
Constructor Overloads |
Description |
---|---|
IngresDataAdapter() |
Instantiates a new instance of the IngresDataAdapter class using default property values |
IngresDataAdapter |
Instantiates a new instance of the IngresDataAdapter class using the defined IngresCommand as the SelectCommand. |
IngresDataAdapter |
Instantiates a new instance of the IngresDataAdapter class using the defined command text for a new instance of IngresCommand for the SelectCommand, and the IngresConnection object |
IngresDataAdapter |
Instantiates a new instance of the IngresDataAdapter class using the defined command text for the SelectCommand and a connection string |
The IngresError class represents error or warning information returned by the Ingres database.
The IngresError class can be declared as follows:
C#: [Serializable] public sealed class IngresError
VB.NET: NotInheritable Public Class IngresError
The following is an implementation of the IngresError class:
static void PrintErrorCollection(IngresErrorCollection errcol)
{
foreach(IngresError err in errcol)
{
PrintError(err);
}
Console.WriteLine("");
}
static void PrintError(IngresError err)
{
Console.Write(err.GetType().ToString() + ":\n");
Console.Write("\t" + "Message = " +
(err.Message !=null?
err.Message.ToString() :"<null>") + "\n");
Console.Write("\t" + "Source = " +
(err.Source!=null?err.Source.ToString():"<null>") + "\n");
Console.Write("\t" + "ToString: " + err.ToString() + "\n");
Console.Write("\t" + "Number = " +
(err.Number.ToString()) + "\n");
Console.Write("\t" + "SQLState = " +
(err.SQLState !=null?
err.SQLState.ToString() :"<null>") + "\n");
Console.WriteLine("");
}
The IngresError class has the following properties:
Property |
Accessor |
Description |
---|---|---|
Message |
get |
A description of the error. |
Number |
get |
The database-specific error integer information returned by the Ingres database. |
Source |
get |
Name of the data provider that generated the error. Always "Ingres." |
SQLState |
get |
The standard five-character SQLSTATE code. |
The public methods available to the IngresError class are:
Method |
Description |
ToString |
A description of the error in the form of "IngresError: error-message-text". |
The IngresErrorCollection class represents a collection of the IngresError objects returned by the Ingres database. Created by IngresException, an IngresErrorCollection collection always contains at least one instance of IngresError.
The declarations for the IngresErrorCollection class are:
C#: [Serializable]
public sealed class IngresErrorCollection : ICollection, IEnumerable
VB.NET: <Serializable]>
NotInheritable Public Class IngresError
Inherits ICollection Implements IEnumerable
The following is an example implementation of the IngresErrorCollection class:
static void PrintErrorCollection(IngresErrorCollection errcol)
{
foreach(IngresError err in errcol)
{
PrintError(err);
}
Console.WriteLine("");
}
static void PrintError(IngresError err)
{
Console.Write(err.GetType().ToString() + ":\n");
Console.Write("\t" + "Message = " +
(err.Message !=null?
err.Message.ToString() :"<null>") + "\n");
Console.Write("\t" + "Source = " +
(err.Source!=null?err.Source.ToString():"<null>") + "\n");
Console.Write("\t" + "ToString: " + err.ToString() + "\n");
Console.Write("\t" + "Number = " +
(err.Number.ToString()) + "\n");
Console.Write("\t" + "SQLState = " +
(err.SQLState !=null?
err.SQLState.ToString() :"<null>") + "\n");
Console.WriteLine("");
}
The IngresErrorCollection class has the following properties:
Property |
Accessor |
Description |
---|---|---|
Count |
get |
The number of errors in the collection. |
Item |
get |
Gets the IngresError for a given ordinal. This property is the C# indexer for IngresErrorCollection class. |
The public methods available to the IngresErrorCollection class are:
Method |
Description |
CopyTo |
Copies the elements of IngresErrorCollection to an Array. |
The IngresException class represents the exception that is thrown when error information is returned by the Ingres database.
The IngresException is declared as follows:
C#: [Serializable]
public sealed class IngresException : SystemException
VB.NET: <Serializable>
NotInheritable Public Class IngresException
Inherits SystemException
The following is an example implementation of the IngresException class:
static void PrintException(IngresException ex)
{
Console.Write(ex.GetType().ToString() + ":\n");
Console.Write("\t" + "Errors = " +
(ex.Errors !=null?ex.Errors.ToString() :
"<null>") + "\n");
Console.Write("\t" + "HelpLink = " +
(ex.HelpLink !=null?ex.HelpLink.ToString() :
"<null>") + "\n");
Console.Write("\t" + "InnerException = " +
(ex.InnerException!=null?ex.InnerException.ToString():
"<null>") + "\n");
Console.Write("\t" + "Source = " +
(ex.Source !=null?ex.Source.ToString() :
"<null>") + "\n");
Console.Write("\t" + "TargetSite = " +
(ex.TargetSite!=null?ex.TargetSite.ToString():"<null>") + "\n");
Console.WriteLine("");
}
The IngresException class contains the following properties:
Property |
Accessor |
Description |
---|---|---|
Errors |
get |
An ErrorCollection of one or more Error objects that give more detailed information on the exception generated by the provider. |
InnerException |
get |
The nested Exception instance that caused the current exception. Inherited from Exception. |
Message |
get |
A concatenation of all the messages in the Errors collection. |
Source |
get |
Name of the data provider that generated the error. Always "Ingres." |
StackTrace |
get |
A string representation of the frames on the call stack at the time the current exception was thrown. |
TargetSite |
get |
The method that threw the current exception. Inherited from Exception. |
The public methods available to the IngresException class are:
Method |
Description |
---|---|
ToString |
The description of the exception as a string. |
The IngresFactory class helps generates many of the other Ingres classes in an interoperable data provider model. For each Ingres class that the factory wants to construct, simply call the Ingres constructor for that class and return the object instance.
The IngresFactory class can be declared as follows:
C#: public sealed class IngresFactory : DbProviderFactory
VB.NET: NotInheritable Public Class IngresFactory
Inherits DbProviderFactory
The IngresFactory class has the following public fields:
Field |
Description |
---|---|
Instance |
The static field containing the single instance of IngresFactory. |
The public methods available to the IngresFactory class are:
Method |
Description |
---|---|
CreateCommand |
Creates an instance of IngresCommand using the factory. |
CreateCommandBuilder |
Creates an instance of IngresCommandBuilder using the factory. |
CreateConnection |
Creates an instance of IngresConnection using the factory. |
CreateConnectionStringBuilder |
Creates an instance of IngresConnectionStringBuilder using the factory. |
CreateDataAdapter |
Creates an instance of IngresDataAdapter using the factory. |
CreateDataSourceEnumerator |
Always returns null. |
CreateParameter |
Creates an instance of IngresParameter using the factory. |
CreatePermission |
Creates an instance of IngresPermission using the factory. |
The IngresInfoMessageEventArgs class provides the information on warnings from the database to the delegate method that handles the InfoMessage event.
The IngresInfoMessageEventArgs class is declared as follows:
C#: public sealed class IngresInfoMessageEventArgs : EventArgs
VB.NET: NotInheritable Public Class IngresInfoMessageEventArgs
Inherits EventArgs
The following is an implementation of the IngresInfoMessageEventArgs class:
static void OnInfoMessage(
Object sender, IngresInfoMessageEventArgs e)
{
Console.WriteLine("OnInfoMessage event args: ("+
"ErrorCode=" + e.Number +
", Errors=" + e.Errors +
", Message=\"" + e.Message + "\"" +
", Source=" + e.Source +")");
}
The following are the properties of the IngresInfoMessageEventArgs class:
Property |
Accessor |
Description |
---|---|---|
Errors |
get |
An ErrorCollection of one or more Error objects that give more detailed information on the warnings generated by the provider. |
Message |
get |
A concatenation of all the messages in the Errors collection. |
Number |
get |
The database-specific warning integer information returned by the Ingres database. |
Source |
get |
Name of the data provider that generated the error. Always "Ingres." |
The IngresInfoMessageEventHandler delegate represents the delegate method that handles the InfoMessage event.
The IngresInfoMessageEventHandler class has the following message declaration:
C#: [Serializable]
public delegate void IngresInfoMessageEventHandler
(object sender, IngresInfoMessageEventArgs e)
VB.NET: <Serializable>
Public Delegate Sub IngresInfoMessageEventHandler _
(ByVal sender As Object, ByVal e As
IngresInfoMessageEventArgs)
The following is an implementation of the IngresInfoMessageEventHandler class:
static void DoWork(string connstring)
{
IngresConnection conn = new IngresConnection(connstring);
conn.InfoMessage += new
IngresInfoMessageEventHandler(OnInfoMessage);
<do additional work>
}
static void OnInfoMessage(
Object sender, IngresInfoMessageEventArgs e)
{
Console.WriteLine("OnInfoMessage event args: ("+
"ErrorCode=" + e.Number +
", Errors=" + e.Errors +
", Message=\"" + e.Message + "\"" +
", Source=" + e.Source +")");
}
The IngresMetaDataCollectionNames class presents information on metadata, such as tables, views, and columns. Each member of the class is a constant string suitable for use as collectionName argument for the IngresConnection.GetSchema method.
The collectionNames supported are:
The IngresMetaDataCollectionNames Class can be declared as follows:
C#: public static class IngresMetaDataCollectionNames
VB.NET: Public Shared Class IngresMetaDataCollectionNames
The IngresParameter class represents a parameter for an IngresCommand for each question mark (?) placeholder in the command and, optionally, its mapping to a DataSet column.
The IngresParameter constructor determines the data type of the parameter in the following ways:
The following is an implementation of the IngresParameter class:
static string DemoParameterSSN(
string connstring, int intNumber, string strSSN)
{
IngresConnection conn = new IngresConnection(connstring);
string strName = null;
conn.Open();
IngresCommand cmd = new IngresCommand(
"select name from demo_personnel where number = ? and ssn = ?",
conn);
// add two parameters to the command's IngresParameterCollection
cmd.Parameters.Add(new IngresParameter("Number", intNumber));
IngresParameter parm =
new IngresParameter("SSN", IngresType.VarChar);
parm.Value = strSSN;
cmd.Parameters.Add(parm);
IngresDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
if (reader.IsDBNull(0))
break;
strName = reader.GetString(0);
}
reader.Close();
conn.Close();
return strName;
}
The class declaration for IngresParameter class is:
C#: public sealed class IngresParameter : System.Data.Common.DbParameter, IDataParameter, IDbDataParameter, ICloneable
VB.NET: NotInheritable Public Class IngresParameter
Inherits System.Data.Common.DbParameter
Implements IDataParameter, IDbDataParameter, ICloneable
The properties for the IngresParameter are:
Property |
Accessor |
Description |
---|---|---|
DbType |
get set |
The type that the parameter must be converted to before being passed to the database server. Setting this parameter induces a setting of IngresType property. Default is DbType.String. |
Direction |
get set |
Indicators whether the parameter has an input, input/output, output, or procedure return value. |
IngresType |
get set |
The type that the parameter must be converted to before being passed to the database server. Setting this parameter induces a setting of DbType property. Default is IngresType.NvarChar if the database supports Unicode UTF-16; otherwise the default is IngresType.VarChar. |
IsNullable |
get set |
Indicates whether the parameter accepts null values. |
ParameterName |
get set |
The name of the parameter. Default is "". |
Precision |
get set |
Maximum number of digits for decimal parameters. Default is 0. |
Scale |
get set |
Number of decimal places for decimal parameters. Default is 0. |
Size |
get set |
Maximum size of binary and string data to be sent to the server. Default is inferred from the parameter value. |
SourceColumn |
get set |
The name of the source column mapped to a DataSet. Default is "". |
SourceVersion |
get set |
The DataRowVersion used by an UpdateCommand during an Update operation for setting the parameter. Default is DataRowVersion.Current. |
Value |
get set |
The value of the parameter. Default is null. |
Important! .NET strings are Unicode based. If the application is sending a Unicode string as a parameter to a database field that is ASCII char or varchar, the application can direct the data provider to coerce the Unicode string to an ASCII string on the client side by setting the parameter DbType property to DbType.AnsiString, or the IngresType property to IngresType.VarChar.
The public methods available for the IngresParameter class are:
Method |
Description |
ToString |
The name of the parameter. |
The constructors available to the IngresParameter class are:
Constructor Overloads |
Description |
---|---|
IngresParameter() |
Instantiates a new instance of the IngresParameter class using default property values |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name and DbType. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name and IngresType. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name and System.Object. The DbType and IngresType are inferred from the .NET Type of the object. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name, DbType, and source column name. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name, IngresType, and source column name. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name, DbType, and column size. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name, IngresType, and column size. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name, DbType, column size, and source column name. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name, IngresType, column size, and source column name. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name, DbType, column size, parameter direction, boolean indication of whether or not the field can be null, precision, scale, source column name, DataRowVersion describing the version of a System.Data.DataRow, and the value of the object. |
IngresParameter |
Instantiates a new instance of the IngresParameter class using the defined parameter name, IngresType, column size, parameter direction, boolean indication of whether or not the field can be null, precision, scale, source column name, DataRowVersion describing the version of a System.Data.DataRow, and the value of the object. |
The IngresParameterCollection class represents a collection of all parameters for an IngresCommand object and their mapping to a DataSet object.
The class declaration for IngresParameterCollection class is as follows:
C#: public sealed class IngresParameterCollection : System.Data.Common.DbParameterCollection, IDataParameterCollection, IList, ICollection, IEnumerable
VB.NET: NotInheritable Public Class IngresParameterCollection
Inherits System.Data.Common.DbParameterCollection
Implements IDataParameterCollection, IList, ICollection, IEnumerable
For an example of adding parameters to an IngresParameterCollection, see IngresParameter Class Example.
The IngresParameterCollection has the following properties:
Property |
Accessor |
Description |
Count |
get |
The number of parameters in the collection. |
Item |
get set |
The IngresParameter object for a given ordinal or parameter name. This property is the C# indexer for IngresParameterCollection class. |
The public methods available to the IngresParameterCollection class are:
Method |
Description |
Add |
Adds an IngresParameter to the parameter collection. |
Clear |
Removes all items from the collection. |
Contains |
Indicates whether IngresParameter exists in the collection. True = does exist; False = does not exist. |
CopyTo |
Copies the elements of IngresParameterCollection to an Array. |
IndexOf |
Returns the index of the IngresParameter in the collection. |
Insert |
Inserts the IngresParameter into the collection. |
Remove |
Removes the IngresParameter from the collection. |
RemoveAt |
Removes an IngresParameter with a specified index or name from the collection. |
The IngresPermission class provides additional information that a user has a security level sufficient to access the Ingres database. At present, the class is not used by the Ingres .NET Data Provider. The class is included in the Ingres data provider to provide completeness for the Factory interoperability model. Instead, standard Ingres security and access control is used.
The IngresPermission class can be declared as follows:
C#: public sealed class IngresPermission : DBPermission
VB.NET: NotInheritable Public Class IngresPermission
Inherits DBPermission
The IngresRowUpdatedEventArgs class provides the information for the RowUpdated event of an IngresDataAdapter.
The class declaration for IngresRowUpdateEventArgs is as follows:
C#: public sealed class IngresRowUpdatedEventArgs : RowUpdatedEventArgs
VB.NET: NotInheritable Public Class IngresRowUpdatedEventArgs
Inherits RowUpdatedEventArgs
The IngresRowUpdatedEventArgs has the following properties:
Property |
Accessor |
Description |
---|---|---|
Command |
get |
The IngresCommand executed when DbDataAdapter.Update method is called. |
Errors |
get |
The Exception containing any errors generated by the Ingres .NET Data Provider during the execution of the IngresCommand. Inherited from RowUpdatedEventArgs. |
RecordsAffected |
get |
The number of rows updated, inserted, or deleted during the execution of the UPDATE, INSERT, or DELETE SQL statement. Inherited from RowUpdatedEventArgs. |
Row |
get |
The System.Data.DataRow sent through the DbDataAdapter.Update. Inherited from RowUpdatedEventArgs. |
StatementType |
get |
The type of SQL statement executed. Inherited from RowUpdatedEventArgs. |
Status |
get |
The System.Data.UpdateStatus of the IngresCommand. Inherited from RowUpdatedEventArgs. |
TableMapping |
get |
The DataTableMapping sent through a DbDataAdapter.Update. Inherited from RowUpdatedEventArgs. |
The IngresRowUpdatedEventHandler delegate represents a delegate method that handles the RowUpdated event of an IngresDataAdapter.
The IngresRowUpdateEventHandler class has the following declaration:
C#: [Serializable]
public delegate void Ingres RowUpdated EventHandler
( object sender, IngresRowUpdated EventArgs e)
VB.NET: <Serializable>
Public Delegate Sub Ingres RowUpdatedEventHandler _
(ByVal sender As Object, ByVal e As
IngresRowUpdatedEventArgs)
The IngresRowUpdatingEventArgs class provides the information for the RowUpdating event of an IngresDataAdapter.
The IngresRowUpdatingEventArgs class has the following declaration:
C#: public sealed class IngresRowUpdatingEventArgs : RowUpdatingEventArgs
VB.NET: NotInheritable Public Class Ingres RowUpdatingEventArgs
Inherits RowUpdatingEventArgs
The IngresRowUpdatingEventArgs class has the following properties:
Property |
Accessor |
Description |
Command |
get set |
The IngresCommand executed when DbDataAdapter.Update method is called. |
Errors |
get |
The Exception containing any errors generated by the Ingres .NET Data Provider during the execution of the IngresCommand. Inherited from RowUpdatedEventArgs. |
RecordsAffected |
get |
The number of rows updated, inserted, or deleted during the execution of the UPDATE, INSERT, or DELETE SQL statement. Inherited from RowUpdatedEventArgs. |
Row |
get |
The System.Data.DataRow sent through the DbDataAdapter.Update. Inherited from RowUpdatedEventArgs. |
StatementType |
get |
The type of SQL statement executed. Inherited from RowUpdatedEventArgs. |
Status |
get |
The System.Data.UpdateStatus of the IngresCommand. Inherited from RowUpdatedEventArgs. |
TableMapping |
get |
The DataTableMapping sent through a DbDataAdapter.Update. Inherited from RowUpdatedEventArgs. |
The IngresRowUpdatingEventHandler delegate represents a delegate method that handles the RowUpdating event of an IngresDataAdapter.
The IngresRowUpdatingEventHandler class declaration is as follows:
C#: [Serializable]
public delegate void IngresRowUpdatingEventHandler
( object sender, IngresRowUpdatingEventArgs e)
VB.NET: <Serializable>
Public Delegate Sub Ingres RowUpdatingEventHandler _
(ByVal sender As Object, ByVal e As IngresRowUpdatingEventArgs)
The IngresTransaction class represents a local, non-distributed database transaction. Each connection is associated with a transaction. This object allows manual commit or rollback control over the pending local transaction.
Created by the BeginTransaction method in the IngresConnection object. After Commit() or Rollback has been issued against the transaction, the IngresTransaction object can not be reused and a new IngresTransaction object must be obtained from the IngresConnection.BeginTransaction method if another transaction is desired.
The IngresTransaction class declaration is as follows:
C#: public sealed class IngresTransaction : System.Data.Common.DbTransaction
VB.NET: NotInheritable Public Class IngresTransaction
Inherits System.Data.Common.DbTransaction
The following is an implementation of the IngresTransaction class:
static void DemoTxn(string connstring)
{
IngresConnection conn = new IngresConnection(connstring);
ProviderTransaction txn;
conn.Open();
txn = conn.BeginTransaction();
IngresCommand cmd = new IngresCommand(
"update demo_personnel set name = 'Howard Lane' "+
" where number = 200", conn, txn);
int numberOfRecordsAffected = cmd.ExecuteNonQuery();
Console.WriteLine(numberOfRecordsAffected.ToString() +
" records updated.");
txn.Commit();
conn.Close();
}
The IngresTransaction class has the following properties:
Property |
Accessor |
Description |
Connection |
get |
The IngresConnection object that is associated with the transaction. Null if the transaction or connection is no longer valid. |
IsolationLevel |
get |
The IsolationLevel for this transaction as set in the IngresConnection.BeginTransaction method. |
The IngresTransaction class contains the following methods:
Method |
Description |
Commit |
Commit the database changes. |
Dispose |
Release allocated resources. |
Rollback |
Rollback the database changes. |