当我尝试执行此操作时,我收到一个异常说语法不正确?
string sql= string.Format(@"SELECT valueA
FROM tableA
WHERE columnA = @columnValueA");
var parameters = new MySqlParameter[1];
parameters[0] = new MySqlParameter("@columnValueA", string.Format("{0}","abc"));
foreach (var mySqlParameter in parameters)
{
cmd.Parameters.AddWithValue(mySqlParameter.ParameterName, mySqlParameter.Value);
}
//later I execute, it tells me the syntax is incorrect
-- I am trying to execute something on the database similar to below
SELECT valueA
FROM tableA
WHERE columnA = "abc"