dotConnect Universal Documentation
Devart.Data.Universal Namespace / UniException Class
Members Example

UniException Class
The exception that is generated when server returns an error.
Syntax
Remarks
This class is created whenever the Universal .NET Data Provider encounters an error generated by the server, or UniConnection has been closed before attempting to execute an operation on the server.
Example
The following example generates a UniException due to a missing database, and then displays the exception.
public void ThrowUniException()
{
  string mySelectQuery = "SELECT * FROM Test.Dept";
  UniConnection myConnection =
    new UniConnection("Provider=SQL Server;Data Source=SERVER;Initial Catalog=Northwind;User ID=sa");
  UniCommand myCommand = new UniCommand(mySelectQuery,myConnection);
  try
  {
    myCommand.Connection.Open();
  }
  catch (UniException myException)
  {
    MessageBox.Show("Message: " + myException.Message + "\n");
  }
}
Public Sub ThrowUniException()
  Dim mySelectQuery As String = "SELECT * FROM Test.Dept"
  Dim myConnection As New UniConnection _
    ("Provider=SQL Server;Data Source=SERVER;Initial Catalog=Northwind;User ID=sa")
  Dim myCommand As New UniCommand(mySelectQuery, myConnection)
  Try
    myCommand.Connection.Open()
  Catch myException As UniException
    MessageBox.Show("Message: " + myException.Message + ControlChars.Cr)
  End Try
End Sub
Inheritance Hierarchy

System.Object
   System.Exception
      System.SystemException
         System.Runtime.InteropServices.ExternalException
            System.Data.Common.DbException
               Devart.Data.Universal.UniException

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also