<System.ComponentModel.DataObject()> attribute.
So, I drop a GridView on a webform and set its datasource to an
ObjectDatasource which in turn is using one of my business logic classes.
I'm noticing something I find odd in one of my Gridviews. I have it's
datasource set as an object data source which is using a business logic
class. I set the update method to an update method in my business logic
class and the code does indeed step into this update function when after I
have clicked the Edit button, edit data and then click the Update button on
the GridView. So, there the line in this Update function that looks like
this:
Return Adapter.UpdateCntyAssetsAssetManagement(ant, nlca, ar, an,
cntyAssetsId)
What I find odd is if I stop debugging before the above line, the data in
the database still gets changed.
Can anyone tell me why this might occur?
If this is S.O.P. (standard operating proceedure), what could possibly be
the purpose of creating a business logic layer to begin with?
Thoughts?
I have a couple of other issues with this GridView as well but thought I
should get this one ironed out first.
Thanks
SAL
What's in the rest of the Update function in the BLL? Have you tried
commenting that line out and seeing what happens?
Oliver
I think this is certainly not the expected behavior. I'm wondering whether
there is some component specifcy or project specific things that result to
this problem. Would you try use a very simpler DataAccess class to test
the behavior or your can create a different project for test also.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "SAL" <S...@nospam.nospam>
>Subject: Data Layer, Business logic layer help
>Date: Wed, 10 Oct 2007 14:36:18 -0700
Imports Microsoft.VisualBasic
Imports System.Data.SqlClient
Imports System.Data
Imports CatsDsTableAdapters
<System.ComponentModel.DataObject()> _
Public Class PropertyTypesBLL
Private ptTA As CntyPropertyTypesTableAdapter
Protected ReadOnly Property Adapter() As CntyPropertyTypesTableAdapter
Get
If ptTA Is Nothing Then
ptTA = New CntyPropertyTypesTableAdapter
End If
Return ptTA
End Get
End Property
<System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select,
True)> _
Public Function GetPropertyTypes() As CatsDs.CntyPropertyTypesDataTable
Return Adapter.GetPropertyTypes
End Function
<System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select,
False)> _
Public Function GetPropertyTypeByPropertyTypeId(ByVal propertyTypeId As
Integer) As CatsDs.CntyPropertyTypesDataTable
Return Adapter.GetPropertyTypeByPropertyTypeId(propertyTypeId)
End Function
<System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update,
True)> _
Public Function UpdateCntyPropertyType(ByVal propertyType As String,
ByVal propertyTypeId As Integer) As Boolean
Return Adapter.UpdateCntyPropertyType(propertyType, propertyTypeId)
End Function
End Class
Steve
"Steven Cheng[MSFT]" <stc...@online.microsoft.com> wrote in message
news:mp7Ogj%23CIH...@TK2MSFTNGHUB02.phx.gbl...
I think the cases you provided should be a quite typical one, I'll perform
some test on my side and let you know the result.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "SAL" <S...@nospam.nospam>
>References: <OcbMZW4C...@TK2MSFTNGP03.phx.gbl>
<mp7Ogj#CIHA...@TK2MSFTNGHUB02.phx.gbl>
>Subject: Re: Data Layer, Business logic layer help
>Date: Thu, 11 Oct 2007 09:13:07 -0700
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.
--------------------
>From: stc...@online.microsoft.com (Steven Cheng[MSFT])
>Organization: Microsoft
>Date: Tue, 16 Oct 2007 02:48:48 GMT
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/archive/2004/08/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
>
Any progress on this or does the information in my last reply help some?
Please feel free to let me know if there is anything else need help.
SAL
"Steven Cheng[MSFT]" <stc...@online.microsoft.com> wrote in message
news:HYqO2SiF...@TK2MSFTNGHUB02.phx.gbl...
Glad to hear from you. Sure, welcome to post here if you got any further
results.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "SAL" <S...@nospam.nospam>
>Subject: Re: Data Layer, Business logic layer help
>Date: Fri, 11 Jan 2008 11:11:44 -0800