gpt4 book ai didi

c# - 如何使用 MysqlConnector 调用 mysql 函数?

转载 作者:行者123 更新时间:2023-11-29 01:02:38 26 4
gpt4 key购买 nike

我正在使用:

MySqlCommand comHash = new MySqlCommand("MY_FUNCTION", con);
comHash.CommandType = CommandType.StoredProcedure; // ??
comHash.Parameters.AddWithValue("my_parameter", "value1");
comHash.????

我需要从函数返回值。

最佳答案

我最近也在为同样的问题苦苦挣扎。这是我找到的解决方案。

MySqlCommand comHash = new MySqlCommand("SELECT MY_FUNCTION (?my_parameter)", con);
comHash.CommandType = CommandType.Text;
comHash.Parameters.AddWithValue("my_parameter", "value1");

关于c# - 如何使用 MysqlConnector 调用 mysql 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2013144/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com