ExecuteScalar Method (String, String)

MySQL Connector/Net

Execute a single command against a MySQL database.

Namespace:  MySql.Data.MySqlClient
Assembly:  MySql.Data (in MySql.Data.dll) Version: 6.2.2.0

Syntax

C#
public static Object ExecuteScalar(
	string connectionString,
	string commandText
)
Visual Basic (Declaration)
Public Shared Function ExecuteScalar ( _
	connectionString As String, _
	commandText As String _
) As Object
Visual C++
public:
static Object^ ExecuteScalar(
	String^ connectionString, 
	String^ commandText
)

Parameters

connectionString
Type: System..::.String
Settings to use for the update
commandText
Type: System..::.String
Command text to use for the update

Return Value

The first column of the first row in the result set, or a null reference if the result set is empty.

See Also