我在IIS/Windows上使用MySql.Data版本8.0.22尝试连接到MariaDB 10.4.12 (Linux)。我试图使用MySqlCommandBuilder.DeriveParameters获取参数信息:
cmd.CommandText = "Mail_SaveEvent";
cmd.CommandType = CommandType.StoredProcedure;
MySqlCommandBuilder.DeriveParameters(cmd);存储的proc/例程具有以下参数:
CREATE PROCEDURE shopmail_test.Mail_SaveEvent(
IN inEventTypeID int,
IN inEventDate datetime,
IN inEventServer int,
IN inEventTitle varchar(250),
IN inEventText text,
IN inEventMerchantID int,
IN inEventAuditText text,
IN inEventID int)
SQL SECURITY INVOKER
MODIFIES SQL DATA
BEGIN我认为这可能是一个排序问题(我使用的是utf8和utf8_unicode_ci排序规则),所以我注释掉了所有的文本参数,甚至从例程正文中删除了大部分逻辑,但我仍然得到以下错误:
12/4/2020 11:20 AM][Production ]: Specified cast is not valid.
[12/4/2020 11:20 AM][Production ]: at MySql.Data.MySqlClient.MySqlCommandBuilder.DeriveParameters(MySqlCommand command)有趣的是,如果我尝试访问驻留在Windows上的MariaDB 10.4.17上的相同模式/例程,则命令将被填充,而不会出现任何错误。

快把我逼疯了!有没有人经历过这种情况,并发现了如何解决它?
https://stackoverflow.com/questions/65149579
复制相似问题