Header Ads

  • Breaking News

    SENT Query -- Return DATA SET WEB SERVICE

    '' ส่งค่าแบบ SENT DATA SET   and - Return DATA SET   (From Client)
        Private Sub Button6_Click(DataSet As Object, e As EventArgs) Handles Button6.Click
            Dim dr As DataRow
            Dim ds As DataSet
            Dim sql As String

            sql = "SELECT * FROM TESTDATA WHERE USERID='6'"
            ds = ss.ExcDataAdapter(sql)              '' เรียกใช้งาน Web service

    'แสดงผลลัพธ์  
            For Each dr In ds.Tables(0).Rows
                MsgBox(dr("USERID") & dr("USERNAME"))  

            Next
        End Sub



    '' FROM SERVER                      
        <WebMethod()> _
        Public Function ExcDataAdapter(sql As String) As DataSet
            Dim ds As New DataSet()

            OpenDB()
            Dim command As New OleDbCommand(sql, dbCon)
            dtAdapter.SelectCommand = command
            dtAdapter.Fill(ds)

            Return ds

        End Function

    ไม่มีความคิดเห็น

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728