SqlError::State Property

 

Some error messages can be raised at multiple points in the code for the Database Engine. For example, an 1105 error can be raised for several different conditions. Each specific condition that raises an error assigns a unique state code.

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

public:
property unsigned char State {
	unsigned char get();
}

Property Value

Type: System::Byte

The state code.

State is only set for errors that are received from the server.

For more information on errors generated by SQL Server, see Understanding Database Engine Errors.

The following example displays each SqlError within the SqlErrorCollection collection.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: