【发布时间】:2008-12-15 03:05:59
【问题描述】:
这个问题快把我逼疯了。
我定义了几个表,并且 CRUD 为这些表存储了过程。我已经使用 dbml 映射器将存储的过程连接到 Visual Studio 中的表。
一切正常,除了一张桌子。我的历史表没有命中插入存储过程。
dbml 映射器中表中的插入属性为:
usp_HistoryInsert (ByRef historyID As System.Int32, changeRequestID As System.Int32, statusID As System.Int32, userID As System.Int32, emailSent As System.Boolean, historyDate As System.DateTime, remarks As System.String, statusChanged As System.Boolean)
我正在尝试使用以下代码:
' create new history entry
h1.ChangeRequestID = ChangeID
h1.UserID = Session("UserID")
h1.HistoryDate = DateTime.Now
h1.StatusChanged = ActionID
h1.Remarks = RichTextEditor1.Text
h1.EmailSent = True
h1.StatusID = ActionID
db.Histories.InsertOnSubmit(h1)
db.SubmitChanges()
使用分析器,我可以看到存储的过程没有被命中。我重命名了数据库中的存储过程(试图生成异常),只是为了仔细检查。
如果我尝试手动点击存储过程(如下),它工作正常!
db.usp_HistoryInsert(0, h1.ChangeRequestID, h1.StatusID, h1.UserID, h1.EmailSent, h1.HistoryDate, h1.Remarks, h1.StatusChanged)
以前有人遇到过这个问题吗?
已修复!请参阅下面的答案。有人可以关闭这个吗?
【问题讨论】: