How To Debug Stored Procedures From A C# Debug Session?
Solution 1:
To allow you step through a T-SQL stored procedure on SQL Server while debugging in .NET app you need to:
Read and follow the guide "How to debug stored procedures in Visual Studio .NET (Option 2)"
Here are the pertinent steps from this article...
In Solution Explorer, right-click the project (not the solution) and open the Property pages. Click Configuration Properties in the tree and then click to select the SQL Server Debugging check box on the Debugging page to enable stored procedure debugging.
Set a breakpoint on the line of code that executes the stored procedure.
In Server Explorer, locate and open the stored procedure. Right-click the stored procedure and then click Edit Stored Procedure.
Set a breakpoint in the stored procedure on the SELECT statement, which is the only line of executable code.
Run the project.
Perform the action that triggers the code that calls the stored procedure.
Press F11. Code execution steps from the ExecuteReader method into the stored procedure window.
N.B. I'm not an expert in this as I prefer to use SSMS.
Post a Comment for "How To Debug Stored Procedures From A C# Debug Session?"