Example #1
0
 public SPParameter(string name, DbTypeInfo type, int position, bool isOutput, bool isReadOnly, object defaultValue)
 {
     Name = name;
     TypeInfo = type;
     Position = position;
     IsOutput = isOutput;
     IsReadOnly = isReadOnly;
     DefaultValue = defaultValue;
 }
Example #2
0
        private IEnumerable<Tuple<int, SPParameter>> getParameters(SqlDataReader reader)
        {
            var index = reader.GetColumnLookup();
            foreach (var r in reader)
            {
                var procId = reader.GetInt32(index["ProcedureId"]);

                var typeName = reader.GetString(index["t.name"]);
                var maxLength = reader.GetInt16(index["t.maxLen"]);
                var precision = reader.GetByte(index["t.precision"]);
                var scale = reader.GetByte(index["t.scale"]);
                var typeInfo = new DbTypeInfo(typeName, null, maxLength, precision, scale);

                var name = reader.GetString(index["Name"]);
                var position = reader.GetInt32(index["position"]);
                var isOutput = reader.GetBoolean(index["output"]);
                var isReadOnly = reader.GetBoolean(index["readonly"]);
                var defaultValue = reader.GetValue(index["defaultValue"]);
                var param = new SPParameter(name, typeInfo, position, isOutput, isReadOnly, defaultValue);

                yield return Tuple.Create(procId, param);
            }
        }