locked
can an event handler be created for this RRS feed

  • Question

  •     Dim _ContextBureauFiles As New Web.BureauFileServices.BureauFilesDS
    
    
        Private Sub LabelBuilsFile_Click(sender As System.Object, e As System.Windows.RoutedEventArgs)
    _ContextBureauFiles.spBOSS2012_Submission_Irish_BuildSubFile(StrLedgerKey)
    End Sub
    
    
    the spBOSS2012_Submission_Irish_BuildSubFile fires a stored procedure that builds a text file. What i want to do is fire an event once this has finished.
    Tuesday, February 14, 2012 2:06 PM

Answers

All replies

  • Yes. You have to put your SP calling in a web service (or WCF) and call that service. As all Silverlight service calls are asynchronous you subscribe to the Completed event and !voila!, do whatever you need as soon the call returns.

    Tuesday, February 14, 2012 3:04 PM
  • This is a learning curve for me, How do i goo about doing it 

    I have added  a WCF service to my project 

    Imports System.ServiceModel
    Imports System.ServiceModel.Activation

    <ServiceContract(Namespace:="")>
    <SilverLightFaultBehavior>
    <AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)>
    Public Class SubmissionBuilder

    <OperationContract()>
    Public Sub DoWork()
    End Sub

    ' Add more operations here and mark them with <OperationContract()>

    End Class
    
    
    i currebtly had this function in a domain service class
            Public Function spBOSS2012_Submission_Irish_BuildSubFile(ByVal strledgerRef As String) As Integer
    Try
    Dim LedgerKeyGUID As Guid = New Guid(strledgerRef)
    Dim Result As System.Data.Objects.ObjectResult(Of spBOSS2012_Submission_Irish_BuildSubFile_Result)

    Result = Me.ObjectContext.spBOSS2012_Submission_Irish_BuildSubFile(LedgerKeyGUID)
    Return 1
    Catch ex As Exception
    Return 0
    End Try
    End Function
    Tuesday, February 14, 2012 3:28 PM
  • Hi,

    The following links will help you to consume a WCF service which contains a stored procedure.

    http://www.dotnetfunda.com/articles/article279.aspx

    http://debugmode.net/2011/03/06/stored-procedure-in-wcf-data-service/

    Best wishes,

    Friday, February 17, 2012 5:09 AM