【发布时间】:2020-08-04 19:54:39
【问题描述】:
我在我的班级里有“fattura”这个
public string sommaFattura(String costo)
{
MySqlCommand command = new MySqlCommand();
String sumQuery = "SELECT SUM(`prezzo`) FROM `fatturetemp`";
command.CommandText = sumQuery;
command.Connection = conn.getConnection();
command.Parameters.Add("@prezzo", MySqlDbType.Int32).Value = costo;
conn.openConnection();
//Need the command for take the result
conn.closeConnection();
}
求和查询结果的命令是什么? 我想使用这个命令,插入一个变量。你能纠正我吗?
【问题讨论】:
-
你的代码看起来不像 mysql 见stackoverflow.com/a/17835514/5193536
标签: c# mysql visual-studio-2010