0

Greetings,

I have a trigger created for table ABC to delete records from other tables connected to table ABC's key.
When I run the query from the SQL Server Management, it works without error.
However, when I call sqlDataSource's Delete(), it seems like it's not firing the triggers. Is it a right behavior for aspx to behave like that ?

Thanks.

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by challenger
0

No. If the Delete() method is being called properly, there is no reason why the trigger won't be fired. Trigger is fired by the backend database and has nothing to do with ASP.NET.

0

No. If the Delete() method is being called properly, there is no reason why the trigger won't be fired. Trigger is fired by the backend database and has nothing to do with ASP.NET.

Thanks hemantksh.
Below is what I did.

Codes in delete button_click:

If IsValid() Then
            Dim i As Integer = sqldsUnit.Delete()
            If i > 0 Then
                Response.Redirect("Unit_Main.aspx?village=" & Request.QueryString("village"))
            Else
                ltrlError.Text = "Error deleting record. Please try again."
            End If
        End If

Simple delete command inside sqldatasource with its delete parameter:

DeleteCommand="delete from unit where unitid=@unitid"

<DeleteParameters>
            <asp:QueryStringParameter QueryStringField="id" Name="unitid" />
        </DeleteParameters>

Is there anything that I did wrong ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.