Send feedback on this topic.
Teradata.Client.Provider
TdException Class
Members  Example 



Teradata.Client.Provider Namespace : TdException Class
TdException is a custom exception class reporting errors detected by the .NET Data Provider for Teradata or the Advanced SQL Engine.
Object Model
TdException ClassTdErrorCollection ClassTdError Class
Syntax
'Declaration
 
Public NotInheritable Class TdException 
   Inherits System.Data.Common.DbException
   Implements System.Runtime.Serialization.ISerializable 
'Usage
 
Dim instance As TdException
public ref class TdException sealed : public System.Data.Common.DbException, System.Runtime.Serialization.ISerializable  
Remarks
All errors are reported as an instance of the TdException class. The TdException.TdException.Errors collection reflects the actual errors generated by the SQL Engine, .NET Data Provider for Teradata or the TeraGSS.

Warnings are reported using TdConnection.InfoMessage event.

Example
public TdConnection OpenConnection(String connectionString)
{
    try
    {
        TdConnection cn = new TdConnection(connectionString);
        cn.Open();
        
        return cn;
    }
    catch(TdException e)
    {
        for (int index = 0; index < e.Errors.Count; index++)
        {
            Console.WriteLine(“ERROR: {0} ({1})”, e.Errors[index].Message, 
                                                  e.Errors[index].Number);
        }   
        
        throw;
    }
    
    return null;
}
Inheritance Hierarchy

System.Object
   System.Exception
      System.SystemException
         System.Runtime.InteropServices.ExternalException
            System.Data.Common.DbException
               Teradata.Client.Provider.TdException

Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdException Members
Teradata.Client.Provider Namespace