Oracle® Data Provider for .NET Developer's Guide 11g Release 2 (11.2.0.3) Part Number E23174-02 |
|
|
PDF · Mobi · ePub |
The OracleInfoMessageEventArgs
class provides event data for the OracleConnection.InfoMessage
event. When any warning occurs in the database, the OracleConnection.InfoMessage
event is triggered along with the OracleInfoMessageEventArgs
object that stores the event data.
System.Object
System.EventArgs
Oracle.DataAccess.Client.OracleInfoMessageEventArgs
// C# public sealed class OracleInfoMessageEventArgs
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# using System; using System.Data; using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; class InfoMessageSample { public static void WarningHandler(object src, OracleInfoMessageEventArgs args) { Console.WriteLine("Source object is: " + src.GetType().Name); Console.WriteLine("InfoMessageArgs.Message is " + args.Message); Console.WriteLine("InfoMessageArgs.Source is " + args.Source); } static void Main() { OracleConnection con = new OracleConnection("User Id=scott;" + "Password=tiger;Data Source=oracle;"); con.Open(); OracleCommand cmd = con.CreateCommand(); //Register to the InfoMessageHandler cmd.Connection.InfoMessage += new OracleInfoMessageEventHandler(WarningHandler); cmd.CommandText = "create or replace procedure SelectWithNoInto( " + " empname in VARCHAR2) AS " + "BEGIN " + " select * from emp where ename = empname; " + "END SelectWithNoInto;"; // Execute the statement that produces a warning cmd.ExecuteNonQuery(); // Clean up cmd.Dispose(); con.Dispose(); } }
Namespace: Oracle.DataAccess.Client
Assembly: Oracle.DataAccess.dll
ODP.NET Version: ODP.NET for .NET Framework 2.0 or ODP.NET for .NET Framework 4
See Also:
OracleInfoMessageEventArgs
members are listed in the following tables.
OracleInfoMessageEventArgs Static Methods
The OracleInfoMessageEventArgs
static methods is listed in Table 5-68.
Table 5-68 OracleInfoMessageEventArgs Static Method
Method | Description |
---|---|
|
Inherited from |
OracleInfoMessageEventArgs Properties
The OracleInfoMessageEventArgs
properties are listed in Table 5-69.
Table 5-69 OracleInfoMessageEventArgs Properties
Property | Description |
---|---|
Specifies the collection of errors generated by the data source |
|
Specifies the error text generated by the data source |
|
Specifies the name of the object that generated the error |
OracleInfoMessageEventArgs Public Methods
The OracleInfoMessageEventArgs
methods are listed in Table 5-70.
Table 5-70 OracleInfoMessageEventArgs Public Methods
Method | Description |
---|---|
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
The OracleInfoMessageEventArgs
static method is listed in Table 5-71.
Table 5-71 OracleInfoMessageEventArgs Static Method
Method | Description |
---|---|
|
Inherited from |
See Also:
The OracleInfoMessageEventArgs
properties are listed in Table 5-72.
Table 5-72 OracleInfoMessageEventArgs Properties
Property | Description |
---|---|
Specifies the collection of errors generated by the data source |
|
Specifies the error text generated by the data source |
|
Specifies the name of the object that generated the error |
See Also:
This property specifies the collection of errors generated by the data source.
// C# public OracleErrorCollection Errors {get;}
The collection of errors.
See Also:
This property specifies the error text generated by the data source.
// C# public string Message {get;}
The error text.
See Also:
This property specifies the name of the object that generated the error.
// C# public string Source {get;}
The object that generated the error.
See Also:
The OracleInfoMessageEventArgs
methods are listed in Table 5-73.