SqlHelper class
namespace: Serenity.Data assembly: Serenity.Net.Services
Contains static SQL related helper functions and extensions.
public static class SqlHelper
Public Members
| name | description |
|---|---|
| static AddParamWithValue(…) | Adds the parameter with value to the target command. |
| static Execute(…) | Executes the specified query on the connection. (3 methods) |
| static ExecuteAndGetID(…) | Executes the query and returns the generated identity value. Only works for auto incremented fields, not GUIDs. |
| static ExecuteNonQuery(…) | Executes the statement. |
| static ExecuteReader(…) | Executes the command returning a data reader. (2 methods) |
| static ExecuteScalar(…) | Executes the statement returning a scalar value. (2 methods) |
| static ExecuteUpsert(…) | Executes an UPSERT (insert or update) query on the connection and returns the number of affected rows. The key fields are used to determine whether an existing record is updated or a new record is inserted. |
| static Exists(…) | Executes the query returning true if it has at least one result. |
| static FixParamType(…) | Fixes the type of the parameter to something suitable as a SQL parameter. |
| static LogCommand(…) | Logs the command. |
| static NewCommand(…) | Creates a new command. (2 methods) |
See Also
- Source: SqlHelper.cs