Oracle® Data Provider for .NET Developer's Guide 11g Release 1 (11.1) Part Number B28375-01 |
|
|
View PDF |
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.
Class Inheritance
System.Object
System.EventArgs
Oracle.DataAccess.Client.OracleInfoMessageEventArgs
Declaration
// C# public sealed class OracleInfoMessageEventArgs
Thread Safety
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
Example
// 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(); } }
Requirements
Namespace: Oracle.DataAccess.Client
Assembly: Oracle.DataAccess.dll
Microsoft .NET Framework Version: 1.x or 2.0
See Also:
OracleInfoMessageEventArgs
members are listed in the following tables:
OracleInfoMessageEventArgs Static Methods
The OracleInfoMessageEventArgs
static methods is listed in Table 5-63.
Table 5-63 OracleInfoMessageEventArgs Static Method
Method | Description |
---|---|
|
Inherited from |
OracleInfoMessageEventArgs Properties
The OracleInfoMessageEventArgs
properties are listed in Table 5-64.
Table 5-64 OracleInfoMessageEventArgs Properties
Name | 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-65.
Table 5-65 OracleInfoMessageEventArgs Public Methods
Name | Description |
---|---|
|
Inherited from |
|
Inherited from |
|
Inherited from |
|
Inherited from |
The OracleInfoMessageEventArgs
static method is listed in Table 5-66.
Table 5-66 OracleInfoMessageEventArgs Static Method
Method | Description |
---|---|
|
Inherited from |
See Also:
The OracleInfoMessageEventArgs
properties are listed in Table 5-67.
Table 5-67 OracleInfoMessageEventArgs Properties
Name | 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.
Declaration
// C# public OracleErrorCollection Errors {get;}
Property Value
The collection of errors.
See Also:
This property specifies the error text generated by the data source.
Declaration
// C# public string Message {get;}
Property Value
The error text.
See Also:
This property specifies the name of the object that generated the error.
Declaration
// C# public string Source {get;}
Property Value
The object that generated the error.
See Also:
The OracleInfoMessageEventArgs
methods are listed in Table 5-68.