返回首页

PLS的给我一个正确的代码...

con = New SqlConnection("Data Source=Localhost;Initial Catalog=master;User ID=sa;Password=sa;")

        con.Open()

        cmd = New SqlCommand("select * from dbo.sysobjects where id = object_id('[dbo].[sss]')", con)

        Dim bRet As Boolean = False

        Dim reader As SqlDataReader = cmd.ExecuteReader

        bRet = reader.HasRows

        If (bRet = False) Then

            MsgBox("Table Exists")

        Else

            MsgBox("No more records")

        End If

回答

评论会员: 时间:2