DevTreks.Data/Helpers/SqlIOAsync.cs
/// <summary>
/// Create command object used to call stored procedure.
/// </summary>
/// <param name="procName">Name of stored procedure.</param>
/// <param name="prams">Params to stored procedure.</param>
/// <returns>Command object.</returns>
Create command object used to call stored procedure.
Create command object used to call stored procedure .
private async Task<SqlCommand> CreateCommandAsync(string procName, SqlParameter[] prams)
        {
            await OpenAsync(Helpers.AppSettings.GetConnection(_uri));
            SqlCommand cmd = new SqlCommand(procName, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = procName;
            if (prams != null)
            {
                AttachParameters(cmd, prams);
            }
            return cmd;
        }
private async Task < SqlCommand > CreateCommandAsync ( string procName , SqlParameter [ ] prams ) { await OpenAsync ( Helpers . AppSettings . GetConnection ( _uri ) ) ; SqlCommand cmd = new SqlCommand ( procName , con ) ; cmd . CommandType = CommandType . StoredProcedure ; cmd . CommandText = procName ; if ( prams != null ) { AttachParameters ( cmd , prams ) ; } return cmd ; }
Create command object used to call stored procedure.
Create command object used to call stored procedure .
// make sure connection is open // add proc parameters
None
procName
string
Name of stored procedure.
Name of stored procedure .
prams
SqlParameter[]
Params to stored procedure.
Params to stored procedure .