internal static SqlParameter[] GetSpParameterSet(SqlConnection connection, string spName, bool includeReturnValueParameter) { if (connection == null) { throw new ArgumentNullException("connection"); } SqlParameter[] result; using (SqlConnection sqlConnection = (SqlConnection)((ICloneable)connection).Clone()) { SqlParameter[] spParameterSetInternal = SqlHelperParameterCache.GetSpParameterSetInternal(sqlConnection, spName, includeReturnValueParameter); result = spParameterSetInternal; } return(result); }
///<summary> ///</summary> ///<param name="connectionString"></param> ///<param name="spName"></param> ///<param name="includeReturnValueParameter"></param> ///<returns></returns> ///<exception cref="ArgumentNullException"></exception> public static SqlParameter[] GetSpParameterSet(string connectionString, string spName, bool includeReturnValueParameter) { if (connectionString == null || connectionString.Length == 0) { throw new ArgumentNullException("connectionString"); } if (spName == null || spName.Length == 0) { throw new ArgumentNullException("spName"); } SqlParameter[] result; using (SqlConnection sqlConnection = new SqlConnection(connectionString)) { SqlParameter[] spParameterSetInternal = SqlHelperParameterCache.GetSpParameterSetInternal(sqlConnection, spName, includeReturnValueParameter); result = spParameterSetInternal; } return(result); }