OdbcError.ToString Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the complete text of the error message.

Namespace:   System.Data.Odbc
Assembly:  System.Data (in System.Data.dll)

public override string ToString()

Return Value

Type: System.String

The complete text of the error.

The following example displays each OdbcError within the OdbcErrorCollection collection.

public void DisplayOdbcErrors(OdbcException exception)
{
	for (int i = 0; i < exception.Errors.Count; i++)
	{
		Console.WriteLine("Index #" + i + "\n" +
			"Error: " + exception.Errors[i].ToString() + "\n");
	}
	Console.ReadLine();
}

.NET Framework
Available since 1.1
Return to top
Show: