标题:求助,改错,清空连接池错误
取消只看楼主
a254298492
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-5-19
 问题点数:0 回复次数:0 
求助,改错,清空连接池错误
Private Sub BTRESTORE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTRESTORE.Click
        Dim strsql As String
        Dim con As SqlConnection
        Dim com As SqlCommand
        Dim databasepath As String

        Try
            con = New SqlConnection("server=localhost;database=master;uid=sa;pwd=; ")
            databasepath = TextBox1.Text & "\Backup_HMIS.bak "
            strsql = "restore   database   HMIS   from   disk= ' " & databasepath & " ' "
            com = New SqlCommand(strsql, con)
            con.Open()
            SqlConnection.ClearAllPools()
            com.ExecuteNonQuery()

            con.Close()
            MessageBox.Show("数据库还原成功!请重新启动本系统。 ", "信息提示: ", MessageBoxButtons.OK, MessageBoxIcon.Information)

        Catch ex As Exception
            MessageBox.Show(ex.Message, "错误提示: ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        Finally


        End Try

    End Sub


清空连接池。为什么ClearAllPools()不是System.Data.SqlClient.SqlConnection的成员,
搜索更多相关主题的帖子: 池错误 改错 
2008-05-06 12:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-212709-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.136720 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved