Note that there are some explanatory texts on larger screens.

plurals
  1. POStored Proc not executing with LINQ
    primarykey
    data
    text
    <p>This issue is driving me mad.</p> <p>I have several tables defined, and CRUD stored procs for those tables. I have wired up the stored procs to the tables in Visual Studio using the dbml mapper. </p> <p>All work fine, except for one table. The insert stored proc is not being hit for my history table.</p> <p>The insert property in the table in the dbml mapper is: </p> <pre><code>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) </code></pre> <p>I am attempting to hit it with the following code:</p> <pre><code> ' 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() </code></pre> <p>Using the profiler, I can see the stored proc is not being hit. I renamed the stored proc in the database (in an attempt to generate an exception), just to double check.</p> <p>If I try to manually hit the stored proc (as follows), it works fine!</p> <pre><code>db.usp_HistoryInsert(0, h1.ChangeRequestID, h1.StatusID, h1.UserID, h1.EmailSent, h1.HistoryDate, h1.Remarks, h1.StatusChanged) </code></pre> <p>Has anyone come across this issue before?</p> <p>FIXED! see answer below. Can someone please close this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload