Torna al Thread
Private Sub DataList2_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList2.ItemCommand
If e.CommandName = "Delete" Then
Dim conString = ConfigurationManager.ConnectionStrings("liceoConnectionString")
Dim strConnString As String = conString.ConnectionString
Using scope As New TransactionScope()
Using db As New SqlConnection(strConnString)
db.Open()
Using sqlcmd As New SqlCommand("Delcommento", db)
sqlcmd.CommandType = CommandType.StoredProcedure
sqlcmd.Parameters.AddWithValue("@id", SqlDbType.Int).Value =DataList2.SelectedValue
sqlcmd.ExecuteNonQuery()
End Using
End Using
scope.Complete()
End Using
End Sub