Example #1
0
        private static SqlParameter[] GetSpParameterSetInternal(SqlConnection connection, string spName, bool includeReturnValueParameter)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }
            if (spName == null || spName.Length == 0)
            {
                throw new ArgumentNullException("spName");
            }
            string key = connection.ConnectionString + ":" + spName + (includeReturnValueParameter ? ":include ReturnValue Parameter" : "");

            SqlParameter[] array = SqlHelperParameterCache.paramCache[key] as SqlParameter[];
            if (array == null)
            {
                SqlParameter[] array2 = SqlHelperParameterCache.DiscoverSpParameterSet(connection, spName, includeReturnValueParameter);
                SqlHelperParameterCache.paramCache[key] = array2;
                array = array2;
            }
            return(SqlHelperParameterCache.CloneParameters(array));
        }
Example #2
0
 internal static SqlParameter[] GetSpParameterSet(SqlConnection connection, string spName)
 {
     return(SqlHelperParameterCache.GetSpParameterSet(connection, spName, false));
 }
Example #3
0
 ///<summary>
 ///</summary>
 ///<param name="connectionString"></param>
 ///<param name="spName"></param>
 ///<returns></returns>
 public static SqlParameter[] GetSpParameterSet(string connectionString, string spName)
 {
     return(SqlHelperParameterCache.GetSpParameterSet(connectionString, spName, false));
 }