Foxtable(狐表)用户栏目专家坐堂 → 给别人提供接口,下面代码有错吗?


  共有2242人关注过本帖平板打印复制链接

主题:给别人提供接口,下面代码有错吗?

帅哥哟,离线,有人找我吗?
huhu
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1165 积分:8129 威望:0 精华:0 注册:2015/3/30 10:44:00
给别人提供接口,下面代码有错吗?  发帖心情 Post By:2016/11/17 15:11:00 [只看该作者]

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
' <System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="mywebservices2")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class myWebService2
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function GetState(ByVal ddh As String, ByVal ddhh As String, ByVal lhbbh As String, ByVal rjbb As String) As String
        Dim cnStr As String = "Data Source=(local);Initial Catalog=songjiang;Integrated Security=False;User ID=sa;Password=bdcom103liujy;"
        Dim cn As New SqlClient.SqlConnection(cnStr)
        cn.Open()
        Dim cm As New SqlClient.SqlCommand("s elect 数量 from [可用数量表]  where 订单号 ='" & ddh & "' and 订单行号 = '" & ddhh & "' and 两化表编号 = '" & lhbbh & "' and 软件版本 = '" & rjbb & "'", cn)
        Dim state As String = cm.ExecuteScalar
        cn.Close()
        Return state
    End Function

End Class

图片点击可在新窗口打开查看此主题相关图片如下:error.png
图片点击可在新窗口打开查看



 回到顶部
总数 14 1 2 下一页