2 // System.Data.SqlClient.SqlException
\r
5 // Konstantin Triger <kostat@mainsoft.com>
6 // Boris Kirzner <borisk@mainsoft.com>
8 // (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 namespace System.Data.OracleClient {
\r
37 using System.Data.ProviderBase;
\r
40 * The exception that is thrown when SQL Server returns a warning or error.
\r
41 * This class cannot be inherited.
\r
45 * CURRENT LIMITATIONS
\r
46 * 1. Constructor for serialization SqlException(SerializationInfo info, StreamingContext sc)
\r
48 * 2. Method "void GetObjectData(...,...)" is not supported (serialization)
\r
51 public sealed class OracleException : AbstractDbException {
\r
52 internal OracleException(Exception cause, OracleConnection connection) : base(cause, connection) {}
\r
54 internal OracleException(SQLException cause, OracleConnection connection) : base(cause, connection) {}
\r
56 internal OracleException(string message, SQLException cause, OracleConnection connection) : base(message, cause, connection) {}
\r
58 protected override AbstractDbErrorCollection DbErrors {
\r
67 * Gets the severity level of the error returned from the SQL Server .NET
\r
69 * @return severity level of the first error in the collection.
\r
71 // public byte Class {
\r
73 // SqlErrorCollection errors = Errors;
\r
74 // return errors.Count > 0 ? errors[0].Class : (byte)0;
\r
79 * Gets a collection of one or more SqlError objects that give detailed
\r
80 * information about exceptions generated by the SQL Server .NET Data Provider.
\r
81 * @return collection of SqlError objects
\r
83 internal OracleErrorCollection Errors {
\r
85 return new OracleErrorCollection(_cause, _connection);
\r
90 get { return DbErrorCode; }
\r
94 * Gets the line number within the Transact-SQL command batch or stored
\r
95 * procedure that generated the error.
\r
96 * @return line number of the first error in the collection.
\r
98 // public int LineNumber {
\r
100 // SqlErrorCollection errors = Errors;
\r
101 // return errors.Count > 0 ? errors[0].LineNumber : 0;
\r
106 * Gets a number that identifies the type of error.
\r
107 * @return number that identifies the type of first error in the collection
\r
109 // public int Number {
\r
111 // SqlErrorCollection errors = Errors;
\r
112 // return errors.Count > 0 ? errors[0].Number : 0;
\r
117 * Gets the name of the stored procedure or remote procedure call (RPC)
\r
118 * that generated the error.
\r
119 * @return name of the stored procedure
\r
121 // public String Procedure {
\r
123 // SqlErrorCollection errors = Errors;
\r
124 // return errors.Count > 0 ? errors[0].Procedure : null;
\r
129 * Gets the name of the computer running an instance of SQL Server
\r
130 * that generated the error.
\r
131 * @return name of the computer where error generated
\r
133 // public String Server {
\r
135 // SqlErrorCollection errors = Errors;
\r
136 // return errors.Count > 0 ? errors[0].Server : null;
\r
142 * Gets a numeric error code from SQL Server that represents an error,
\r
143 * warning or "no data found" message.
\r
144 * @return numeric error code from SQL Server
\r
146 // public byte State {
\r
148 // SqlErrorCollection errors = Errors;
\r
149 // return errors.Count > 0 ? errors[0].State : (byte)0;
\r