public void SetPrepareCommand(PrepareCommandInfo info) { MySqlCommand command = new MySqlCommand(info.Sql, conn); int i = 1; foreach (var type in info.ParaTypes) { command.Parameters.Add("@para" + i, type); i++; } command.Prepare(); prepareCommands[info.Name] = command; }
public void SetPrepareCommand(string name, string sql, params MySqlDbType[] paraTypes) { MySqlCommand command = new MySqlCommand(sql, conn); int i = 1; foreach (var type in paraTypes) { command.Parameters.Add("@para" + i, type); i++; } command.Prepare(); prepareCommands[name] = command; prepareCommandInfos[name] = new PrepareCommandInfo(name, sql, paraTypes); }