熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

12.9遠程Web服務—PocketPC應用程序[2]

2013-11-13 10:53:01  來源: .NET編程 

    ()添加如下的Web方法

 

<WebMethod()> _

    Public Sub UpdateGoals(ByVal FixtureID As Integer ByVal GoalFor As Boolean ByVal PlayerID As Integer ByVal GoalTime As Integer)

        Dim conn As New SqlConnection(ConfigurationManagerConnectionStrings(WroxUnited)ConnectionString)

        connOpen()

        Dim cmd As New SqlCommand(usp_UpdateScore conn)

       

        cmdCommandType = CommandTypeStoredProcedure

 

        cmdParametersAdd(@FixtureID SqlDbTypeInt)Value = FixtureID

        cmdParametersAdd(@GoalFor SqlDbTypeBit)Value = GoalFor

 

        cmdExecuteNonQuery()

 

        If GoalFor Then

            Goal(FixtureID PlayerID GoalTime)

        End If

    End Sub

    ()接下來在前一個Web方法的下面添加另一個Web方法

 

<WebMethod()> _  

    Public Sub Goal(ByVal FixtureID As Integer ByVal PlayerID As Integer ByVal GoalTime As Integer)

        Dim conn As New SqlConnection(ConfigurationManagerConnectionStrings(WroxUnited)ConnectionString)

        connOpen()

        Dim cmd As New SqlCommand(usp_Goal conn)

        cmdCommandType = CommandTypeStoredProcedure

        cmdParametersAdd(@FixtureID SqlDbTypeInt)Value = FixtureID

        cmdParametersAdd(@PlayerID SqlDbTypeInt)Value = PlayerID

        cmdParametersAdd(@GoalTime SqlDbTypeInt)Value = GoalTime

        cmdExecuteNonQuery()

    End Sub

    

[]  []  []  []  


From:http://tw.wingwit.com/Article/program/net/201311/14702.html
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.