Class SqlHelper
Helper class to perform SQL functions.
Inheritance
System.Object
SqlHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CrashCABN.Shared
Assembly: CrashCABN.Shared.dll
Syntax
public static class SqlHelper
Methods
View SourceSqlExecuteInsertGeneric(Dictionary<String, String>, String, String)
Executes a Generic SQL insert query.
Declaration
public static async Task SqlExecuteInsertGeneric(Dictionary<string, string> parameters, string sqlDbConnectionString, string procedureName)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | parameters | A dictionary of parameters and values to send to the stored procedure. |
System.String | sqlDbConnectionString | The SQL connection string. |
System.String | procedureName | The name of the stored procedure to run. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Exception if applicable. |
SqlExecuteSelect(Dictionary<String, String>, String, String)
Runs a SQL select query.
Declaration
public static async Task<DataTable> SqlExecuteSelect(Dictionary<string, string> parameters, string sqlDbConnectionString, string procedureName)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | parameters | A dictionary of parameters and values to send to the stored procedure. |
System.String | sqlDbConnectionString | The SQL server to connect to. |
System.String | procedureName | The name of the SELECT procedure to use. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataTable> | A datatable holding the contents of the SELECT query. |
SqlExecuteUpdateGeneric(Dictionary<String, String>, String, String)
Executes a Generic SQL update query.
Declaration
public static async Task SqlExecuteUpdateGeneric(Dictionary<string, string> parameters, string sqlDbConnectionString, string procedureName)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | parameters | A dictionary of parameters and values to send to the stored procedure. |
System.String | sqlDbConnectionString | The SQL connection string. |
System.String | procedureName | The name of the stored procedure to run. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Exception if applicable. |