我在这里有这个代码:
var sql = "select shr_id, shc_id " +
"from tbox_operational.shipment_ref " +
"inner join tbox_operational.shipment_collo_ref using (shr_id) " +
"where shr_insdtm between ?dateTimeFrom";
var parameters = new List<MySqlParameter> {
new MySqlParameter("?dateTimeFrom", dateTimeFrom.ToString("yyyy/MM/dd HH:mm:ss"))
};
var query = (from db in context.Database.SqlQuery<ShridsModel>(sql, parameters)
select db).ToList();
return query;
但它让我得到了这个错误:
{"Parameter '?dateTimeFrom' must be defined."}
我也在我的连接字符串中:
server=xxx;user id=runtime;password=xxxx;AllowUserVariables=True;
我在这里做错了什么?
答案 0 :(得分:0)
我已经解决了......
我没有传递参数列表,而是传递每个人,并且他认出了所有