Hi SAL,
After some further research, I did found an existing record indicate this
problem. Actually, this is the behavior of .NET managed debugging. Here is
the detailed description of the issue:
*** Problem Description *******************************************
Behavior
There are cases, when program execution continues after 'Stop debugging'
option
(menu or toolbar) selected in Visual Studio .NET.
Steps to reproduce behavior
1. Create default ASP.NET VB application
2. Add WebForm
3. Add Button to WebForm
4. Add following code to WebForm (you will, probably, have to update
connection
string):
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Handles Button1.Click
Dim cn As New SqlClient.SqlConnection("server=.;uid=sa;pwd=;initial
catalog=Northwind;")
cn.Open()
Dim cmd As New SqlClient.SqlCommand("update categories set
categoryname=categoryname+'1' where categoryid=1", cn)
cmd.ExecuteNonQuery()
End Sub
5. Set breakpoint on first line of Button1_Click and run the program.
6. Hit 'Stop Debugging' button immediately after debugger reach breakpoint.
7. Inspect your database. In most cases it will be updated!
************************************************
So far you can consider the following resolution:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Cause
Turns out that VS.NET debugger does not suppose to halt managed process
execution
when you 'Stop Debugging'. It is just detaches from process. With unmanaged
code,
this requires killing process.
Resolution
If you will check "Unmanaged code debugging' option in
Project>Properties>Configuration Properties>Debugging, execution will stop
immediately, when 'Stop Debugging' selected.
This article was found at the following link
http://dotnetjunkies.com/WebLog/leon.../10/21590.aspx
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Date: Thu, 18 Oct 2007 08:59:35 GMT
>Subject: Re: Data Layer, Business logic layer help
>
>Hi SAL,
>
>After some testing, I've repro this problem and got the same behavior as
>you mentioned. Currently I'll do some further research on this and will
let
>you know if I get any new update.
>
>Sincerely,
>
>Steven Cheng
>
>Microsoft MSDN Online Support Lead
>
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
>
>