数据库断不开?把你的代码贴出来看看。 <WebMethod(Description:="Delete one book from database by the owner of the book.", BufferResponse:=False)> _
    Public Function DelBook(ByVal id As String, ByVal ip As String) As Boolean
        Dim strSql As String
        Dim oleDbCommand As OleDbCommand        Try
            conn.Open()
            strSql = "delete from books where id =" & id
            oleDbCommand = New OleDbCommand(strSql, conn)
            oleDbCommand.ExecuteNonQuery()
            Return True
        Catch ex As Exception
        Finally
            conn.Close()
        End Try
        Return False
    End Function
以上程序经过测试,正常断开了阿。

解决方案 »

  1.   

    我是在winform里面调用webservice,然后在winform做一个断开连结
    比如 webservice 
         <WebMethod(Description:="login database BufferResponse:=False)> _
       
         Public Function login() As Boolean
           
         End Function   <WebMethod(Description:="login database BufferResponse:=False)> _
        Public Function logout() As Boolean
           
        End Functionwinform 的名称为 form_test,还有一个button
    button的代码为 : 
      dim lfrm_test as new form_test
    lfrm_test.login
    lfrm_test.logout
      

  2.   

    在你的webservice 中的login_out 是肯定是寫你的數據庫斷開部分的代碼...