Exemplo n.º 1
0
        /// <summary>
        /// 加入参数(MYSQL)
        /// </summary>
        /// <param name="cmd">MySql命令</param>
        /// <param name="parameters">参数集合</param>
        /// <returns></returns>
        private static IDbCommand AddParameters(this MySqlCommand cmd, CommandParameterCollection parameters)
        {
            if (parameters == null || parameters.Count == 0)
            {
                return(cmd);
            }

            // 加入参数
            foreach (CommandParameter item in parameters)
            {
                cmd.Parameters.Add(item.ColumnName, item.DBType.ToOracleType(), item.Length).Value = item.Value;
            }

            return(cmd);
        }
 /// <summary>
 /// 预设
 /// </summary>
 /// <param name="coll"></param>
 public MyEnumerator(CommandParameterCollection coll)
 {
     collection = coll;
     index      = -1;
 }
Exemplo n.º 3
0
 private static IDbCommand AddParameters(this OleDbCommand cmd, CommandParameterCollection parameters)
 {
     throw new NotImplementedException("沒有实现 OleDb AddParameters!");
 }