https://www.baidu.com/baidu?word=vb.net+%E6%9F%A5%E8%AF%A2%E6%95%B0%E6%8D%AE%E5%BA%93&ie=utf-8&tn=myie2dg&ch=6
<WebMethod()> _
Public int add(int a,int b)
Dim cnStr As String = "Data Source=(local);Initial Catalog=Sales;Integrated Security=False;User ID=sa;Password=123456;"
Dim cn As New SqlClient.SqlConnection(cnStr)
cn.Open()
Dim cm As New SqlClient.SqlCommand("select 状态 from [临时版本跟踪表] where 编号 ='XXXX'", cn)
Dim state As Integer = cm.ExecuteScalar
cn.Close()
Return state
End Function