12. Understanding .NET Data Provider Connectivity : .NET Data Provider Classes : IngresError Class : IngresError Class Example
 
Share this page                  
IngresError Class Example
The following is an implementation of the IngresError class:
static void PrintErrorCollection(IngresErrorCollection errcol)
{
    foreach(IngresError err in errcol)
    {
        PrintError(err);
    }
    Console.WriteLine("");
}
 
static void PrintError(IngresError err)
{
    Console.Write(err.GetType().ToString() + ":\n");
    Console.Write("\t" + "Message = " +
        (err.Message !=null?
            err.Message.ToString() :"<null>") + "\n");
    Console.Write("\t" + "Source = " +
        (err.Source!=null?err.Source.ToString():"<null>") + "\n");
    Console.Write("\t" + "ToString: " + err.ToString() + "\n");
    Console.Write("\t" + "Number = " +
        (err.Number.ToString()) + "\n");
    Console.Write("\t" + "SQLState = " +
        (err.SQLState !=null?
            err.SQLState.ToString() :"<null>") + "\n");
    Console.WriteLine("");
}