SqlHelper..::..ExecuteScalar Method (String, CommandType, String, array<SqlParameter>[]()[][])
Execute a SqlCommand (that returns a 1x1 resultset) against the database specified in the connection string
using the provided parameters.
Namespace:
CoreAssembly: Core (in Core.dll)
Syntax
public static Object ExecuteScalar( string connectionString, CommandType commandType, string commandText, params SqlParameter[] commandParameters )
Parameters
- connectionString
- Type: String
A valid connection string for a SqlConnection
- commandType
- Type: CommandType
The CommandType (stored procedure, text, etc.)
- commandText
- Type: String
The stored procedure name or T-SQL command
- commandParameters
- Type: array<SqlParameter>[]()[][]
An array of SqlParamters used to execute the command