Subsonic 3 - 更新 NullReferenceException
我正在使用 Subsonic v3.0.0.3 和 Linq 模板。 我正在尝试使用以下内容更新 SQL Server Express 数据库中的记录:
var db = new MyDB(Constants.Database);
db.Update<Contact>()
.Set(d => d.FirstName == contact.FirstName)
.Where(d => d.Id == contact.Id)
.Execute();
执行此行时,我收到 NullReferenceException
。 堆栈跟踪如下:
at SubSonic.Query.Update.GetCommand()
at SubSonic.Query.Update.Execute()
有人可能能够提出问题所在吗?
I am using Subsonic v3.0.0.3 with the Linq templates. I am attempting to update a record in a SQL Server Express database with the following:
var db = new MyDB(Constants.Database);
db.Update<Contact>()
.Set(d => d.FirstName == contact.FirstName)
.Where(d => d.Id == contact.Id)
.Execute();
I am receiving a NullReferenceException
when this line is executed. The stack trace is as follows:
at SubSonic.Query.Update.GetCommand()
at SubSonic.Query.Update.Execute()
Any chance that someone may be able to suggest what the problem is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我做了一个简单的更新,给了我一个 NullReferenceException
在进入代码后,我发现 Query/update.cs L186 中的行
ColumnName = column.QualifiedName
应该是ColumnName = column.Name
。纠正此问题后,更新运行良好。 希望有人可以检查一下。
I did a simple update which give me an NullReferenceException
After step into the code, I found the line in Query/update.cs L186
The
ColumnName = column.QualifiedName
should beColumnName = column.Name
.After correct this, update runs well. Hope some one can check this.
嗯 - 我想说要确保连接字符串存在(我将在未来几周内修复缺少连接字符串的错误消息),除此之外 - 这看起来像一个问题 - 你介意在 Github 上发布吗?
Hmm - I would say to make sure the connection string is present (I'll be fixing the error message for missing connection strings in the coming weeks) other than that - this looks like an issue - would you mind posting at Github?