我无法理解这个错误。服务器错误指出这一行:
<select name="selectUserName">
@foreach(var row in db.Query(selectQueryString)) {
<option>@row.username</option>
}
</select>
其中 selectQueryString
定义为:
var selectQueryString = "SELECT ID, username FROM user";
最佳答案
用户是 reserved word在 SQL Server 中。尝试:
FROM [User]
关于C#/SQL 错误 : There was an error parsing the query. [ token 行号 = 1, token 行偏移量 = 26,错误中的 token = 用户 ],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14857766/