using mojoPortal.Data; using System.Data.SqlClient; int numRows = (int)SqlParameterHelper.ExecuteScalar(connectionString, "SELECT COUNT(*) FROM MyTable");
using mojoPortal.Data; using System.Data.SqlClient; int maxVal = (int)SqlParameterHelper.ExecuteScalar(connectionString, "SELECT MAX(MyColumn) FROM MyTable");In this example, the ExecuteScalar method is used to execute a SQL command that finds the maximum value in the "MyColumn" column of the "MyTable" table. The result is cast to an integer and stored in the maxVal variable. Overall, SqlParameterHelper.ExecuteScalarexecute is a useful method that simplifies working with parameterized SQL commands and provides a convenient way to execute SQL queries in C#.