Note that there are some explanatory texts on larger screens.

plurals
  1. POC# LINQ Stored Procedure
    text
    copied!<p>I have a C# windows service that communicates with a SQL Server 2008 database via LINQ. Within LINQ, I have a few stored procedures defined. My service basically wakes up every couple of minutes and looks in the database for things to process. While processing, for each new record it runs a stored procedure. Once all of the records are processed, it runs another stored procedure. I have a very weird problem going on. For the first stored procedure (run with each record), things run fine. The procedure gets called, functions properly, and the code continues past the call. For the second procedure (run one all records processed), the service just hangs. I don't get an error message, it doesn't crash, it still seems to be running, but it never does anything until I restart the service. If I run the procedure manually in SQL Server Management Studio, it executes properly and completes. I am hoping somebody has an idea for what's going on here.</p> <p>Within the loop of each record:</p> <pre><code>if (Settings.Default.SQLSpatialEnabled) { try { if ((bool) f.sdrFaultType.TripFault) { DataContext.sp_locateFault ((int) f.ID); } } catch (Exception ex) { Logger.Logger.Trace ("Locate fault (" + f.ID + ") exception: " + ex.Message); } } </code></pre> <p>After all records:</p> <pre><code>if (Settings.Default.SQLSpatialEnabled) { DataContext.sp_mapFaults (); Logger.Logger.Trace ("Faults Mapped"); } </code></pre> <p>The 'Faults Mapped' never shows up in the log and everything basically stops.</p>
 

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