Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports kemet.Never.DA
Imports kemet.Never.BL
Imports System.Data.SqlClient
Imports System.Data
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
Inherits System.Web.Services.WebService
Private _DBTrans As kemet.Never.DA.DBTransaction
Private _BL As kemet.Never.BL.Query
Private _connectionString As String = ""
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
'Public Sub New(ByVal connectionString As String)
' _connectionString = connectionString
'End Sub
<WebMethod()> _
Public Function Binding(ByVal r As re) As DataSet
_connectionString = r.connec
' "Data Source=LDBYYQ3R1\MYSQLTEST; Initial Catalog=MES_TRANS_MCD; User ID=sa; PassWord=admin; Persist Security Info=False;"
_DBTrans = New kemet.Never.DA.DBTransaction("", _connectionString)
_BL = New kemet.Never.BL.Query(_DBTrans)
Dim resultDS As New DataSet
Try
resultDS = _BL.GetJobInfo2("FPI162236TMW3N")
Return resultDS
Catch ex As Exception
Throw ex
End Try
End Function
'Public Sub New()
' MyBase.New()
' InitialLizeComponet()
'End Sub
'Private components As System.ComponentModel.IContainer
'<System.Diagnostics.DebuggerStepThrough()> Private Sub InitialLizeComponet()
' components = New System.ComponentModel.Container()
'End Sub
'Protected Overrides Sub Dispose(ByVal disposing As Boolean)
' If disposing Then
' If Not (components Is Nothing) Then
' components.Dispose()
' End If
' End If
' MyBase.Dispose(disposing)
'End Sub
End Class
Public Class re
Public pn As String
Public job As String
Public connec As String
End Class
本文介绍了一个使用ASP.NET创建Web服务的示例代码。该Web服务包含两个方法:HelloWorld方法返回简单的问候消息;Binding方法接收参数并返回数据集。示例展示了如何使用kemet.Never库进行数据库操作。
1374

被折叠的 条评论
为什么被折叠?



