解析查询时出错。[令牌行号= 1,令牌行偏移量= 52,令牌错误=)]
技术问答
217 人阅读
|
0 人回复
|
2023-09-12
|
试着将数据插入我的数据SQl以下错误发生在数据库中,System.Data.SqlServerCe.SqlCeException: There was anerror parsing the query. [ Token line number = 1,Token line offset = 52,Tokenin error = ) 我输入数据的代码行如下:
! z, `5 J; I/ t; o@{var db= Database.Open("Games");var sqlQ = "SELECT * FROM Games";var data = db.Query(sqlQ); }@{if (IsPost) var fileData = Request.Files var fileName = Path.GetFileName(fileData.FileName); var fileSavePath = Server.MapPath("~/upload/" fileName); fileData.SaveAs(fileSavePath); var GameName=Request["Name"]; var Gamefile = fileName; var SQLINSERT = "INSERT INTO Games (Name,file_path) " "VALUES (@0,@1,)"; db.Execute(SQLINSERT,GameName,Gamefile); 我试图将文件上传到我的服务器中,并将文件名添加到我的数据库中。这个错误显然与第15行有关。5 n; `; t/ e# N# N n, K
/ L8 f2 K" j8 c 解决方案: |
|
|
|
|
|