Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 存储过程未使用LINQ执行_Asp.net_Vb.net_Linq - Fatal编程技术网

Asp.net 存储过程未使用LINQ执行

Asp.net 存储过程未使用LINQ执行,asp.net,vb.net,linq,Asp.net,Vb.net,Linq,这个问题快把我逼疯了 我定义了几个表,并为这些表存储了CRUD过程。我已经使用dbml映射器将存储的进程连接到VisualStudio中的表 除了一张桌子外,一切都很好。我的历史记录表没有命中insert stored proc dbml映射器表中的insert属性为: usp_HistoryInsert (ByRef historyID As System.Int32, changeRequestID As System.Int32, statusID As System.Int32, use

这个问题快把我逼疯了

我定义了几个表,并为这些表存储了CRUD过程。我已经使用dbml映射器将存储的进程连接到VisualStudio中的表

除了一张桌子外,一切都很好。我的历史记录表没有命中insert stored proc

dbml映射器表中的insert属性为:

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()
使用探查器,我可以看到存储的进程没有被命中。我重命名了数据库中存储的proc(试图生成一个异常),只是为了再次检查

如果我尝试手动点击存储的进程(如下所示),它可以正常工作

db.usp_HistoryInsert(0, h1.ChangeRequestID, h1.StatusID, h1.UserID, h1.EmailSent, h1.HistoryDate, h1.Remarks, h1.StatusChanged)
以前有人遇到过这个问题吗


修正!见下面的答案。有人可以关闭这个吗?

您是否手动将存储过程连接到.dbml文件中的表?如果在特性网格中选择表a,则可能会看到插入行为。如果显示“使用运行时”,则不会调用存储过程,您必须从“使用运行时”更改该设置,以手动将其配置为在插入时调用存储过程。

好的,这是难以置信的,但是。。。该应用程序已经有一个名为history.aspx的页面。VB默认为该页面的历史类,而不是LinQ使用的db.history类


一旦我重命名了history.aspx,一切都正常了!:)

它没有说使用运行时,在Insert旁边有存储的proc调用:(