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



Teradata.Client.Provider Namespace : TdErrorCollection Class
Holds zero or more instances of the TdError class.
Object Model
TdErrorCollection ClassTdError Class
Syntax
'Declaration
 
Public NotInheritable Class TdErrorCollection 
   Implements System.Collections.ICollectionSystem.Collections.IEnumerable 
'Usage
 
Dim instance As TdErrorCollection
public sealed class TdErrorCollection : System.Collections.ICollectionSystem.Collections.IEnumerable  
public ref class TdErrorCollection sealed : public System.Collections.ICollectionSystem.Collections.IEnumerable  
Remarks
.NET Data Provider for Teradata returns errors and warnings using the TdError class.

TdException.TdException.Errors property is an instance of the TdErrorCollection class and holds at least one instance of the TdError class.

TdInfoMessageEventArgs.TdInfoMessageEventArgs.Errors property is an instance of TdErrorCollecation class and holds at least zero or more instances of the TdError class.

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
   Teradata.Client.Provider.TdErrorCollection

Requirements

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

See Also

Reference

TdErrorCollection Members
Teradata.Client.Provider Namespace