WebService代码

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Data.OleDb


<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function HelloWorld() As String
        Return "Hello World"
    End Function   
    <WebMethod()> _
    Public Function getpassword(ByVal namecode As String, ByRef f001 As Integer, ByRef f002 As Integer, ByVal qpass As String) As Boolean
        If qpass <> "123" Then
            Exit Function
        End If
        Dim conn As OleDbConnection = New OleDbConnection("Provider=MSDAORA;Data Source=tsmtsfc;User ID=hftmis;Password=TRACLEMis;")
        conn.Open()
        Dim dap As New OleDbDataAdapter("select * from sys0003 where f003 like ‘" & namecode & "%‘", conn)
        Dim dst As New DataSet
        dap.Fill(dst)
        Dim rsu As String = ""

        給回傳值F001,F002賦值------------------------------------
        f001 = CInt(dst.Tables(0).Rows(0).Item("f001").ToString())
        f002 = CInt(dst.Tables(0).Rows(0).Item("f002").ToString())
        ---------------------------------------------------------
        Return True
    End Function



    <WebMethod()> _
    Public Function getxml() As String

        Dim conn As OleDbConnection = New OleDbConnection("Provider=MSDAORA;Data Source=cnxinwa;User ID=cnxinwa;Password=qq6872397;")
        conn.Open()
        Dim dap As New OleDbDataAdapter("select * from cnxinwa0001", conn)
        Dim dst As New DataSet
        dap.Fill(dst, "sys0001")

        Return dst.GetXml

    End Function



End Class

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。