ToString method

Description

Identifies the complete text of the error message.

Syntax

public string ToString( )

Usage

The return value is a string is in the form “AseError:”, followed by the message. For example:

AseError:UserId or Password not valid.

Description

The message state. Used as a modifier to the MsgNumber.

Syntax

public int State

Description

The severity of the message.

Syntax

public int Severity

Description

The name of the server that is sending the message.

Syntax

public string ServerName

Description

The name of the stored procedure or remote procedure call (RPC) in which the message occurred.

Syntax

public string ProcName

Description

The line number in the command batch or the stored procedure that has the error, if applicable.

Syntax

public int LineNum

Description

Associated with the extended message.

Syntax

public int Status

Description

The current state of any transactions that are active on this dialog.

Syntax

public int TranState

Description

The error message that comes from the Adaptive Server server.

Syntax

bool IsFromServer

Usage

The return value is “true” or “false.”

if (ex.Errors[0].IsInformation )
	MessageBox.Show(“ASE has reported the following error: “ + ex.Errors[0].Message);

Description

The error message that comes from Adaptive Server ADO.NET Data Provider.

Syntax

bool IsFromClient

Usage

The return value is “true” or “false.”

if (ex.Errors[0].IsInformation )
	MessageBox.Show(“ASE has reported the following error: “ + ex.Errors[0].Message);

Description

The message is considered an error.

Syntax

bool IsError

Usage

The return value is “true” or “false.”

if ( ! ex.Errors[0].IsInformation )
	MessageBox.Show(“Error: “ + ex.Errors[0].Message):

Description

The message is a warning that things might not be quite right.

Syntax

bool IsWarning

Usage

The return value is “true” or “false.”

if ( ! ex.Errors[0].IsInformation )
	MessageBox.Show(“Error: “ + ex.Errors[0].Message):

Description

An informative message, providing information such as the active catalog has changed.

Syntax

bool IsInformation

Usage

The return value is “true” or “false.”

if ( ! ex.Errors[0].IsInformation )
	MessageBox.Show(“Error: “ + ex.Errors[0].Message):