Language

SqlBatch.ExecuteScalar Method

Definition

Executes the batch and returns the first column of the first row in the first returned result set. All other columns, rows and resultsets are ignored.

public:
 System::Object ^ ExecuteScalar();
public:
 override System::Object ^ ExecuteScalar();
public object ExecuteScalar();
public override object ExecuteScalar();
member this.ExecuteScalar : unit -> obj
override this.ExecuteScalar : unit -> obj
Public Function ExecuteScalar () As Object
Public Overrides Function ExecuteScalar () As Object

Returns

The first column of the first row in the first result set.

Exceptions

An error occurred while executing the batch.

Applies to