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

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

2022-06-13   來源: .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-2022 電腦知識網 Computer Knowledge   All rights reserved.