OdbcError.Source Property

 
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 name of the driver that generated the error.

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

public string Source { get; }

Property Value

Type: System.String

The name of the driver that generated the error.

The following example displays the properties of an OdbcError.

public void DisplayOdbcErrorCollection(OdbcException exception)
{
	for (int i = 0; i < exception.Errors.Count; i++)
	{
		Console.WriteLine("Index #" + i + "\n" +
			"Message: " + exception.Errors[i].Message + "\n" +
			"Native: " + exception.Errors[i].NativeError.ToString() + "\n" +
			"Source: " + exception.Errors[i].Source + "\n" +
			"SQL: " + exception.Errors[i].SQLState + "\n");
	}
	Console.ReadLine();
}

.NET Framework
Available since 1.1
Return to top
Show: