public In[] ConvertToNamedParameters(int indexToStart, object[] values)
 {
     var pars = new In[values.Length];
     for (int i = 0; i < values.Length; i++) {
         pars[i] = values[i] as In;
         if (pars[i] == null) {
             pars[i] = new In {Name = GetParameterName(i + indexToStart), Value = values[i]};
         }
     }
     return pars;
 }
Beispiel #2
0
        public In[] ConvertToNamedParameters(int indexToStart, object[] values)
        {
            var pars = new In[values.Length];

            for (int i = 0; i < values.Length; i++)
            {
                pars[i] = values[i] as In;
                if (pars[i] == null)
                {
                    pars[i] = new In {
                        Name = GetParameterName(i + indexToStart), Value = values[i]
                    };
                }
                else if (String.IsNullOrEmpty(pars[i].Name))
                {
                    pars[i].Name = GetParameterName(i + indexToStart);
                }
            }
            return(pars);
        }
Beispiel #3
0
 private IDbDataParameter GetInParameter(In p)
 {
     IDbDataParameter par = Provider.GetParameter();
     par.ParameterName = p.Name;
     par.Value = p.Value ?? DBNull.Value;
     return par;
 }
Beispiel #4
0
 private IDbDataParameter GetInParameter(In p, IDbCommand cmd, bool isBulk)
 {
     IDbDataParameter par = Provider.GetParameter(p, isBulk);
     par.Direction = ParameterDirection.Input;
     par.Value = p.Value ?? DBNull.Value;
     par.ParameterName = p.Name;
     return par;
 }