Dim con
As New SqlClient.SqlConnection("
data source = .sqlexpress;database = master ; Integrated Security=True")
Dim cmd
As New SqlClient.SqlCommand(Nothing, con)
Dim reader
As SqlClient.SqlDataReader
cmd.CommandText = "
SELECT count(*) FROM sys.sysdatabases WHERE [NAME]=
Try
con.Open()
Dim a
As Integer = CType(cmd.ExecuteScalar(), Integer)
If a >
0 Then
MessageBox.Show("Your
database exist...")
Else
MessageBox.Show("Not found....")
End If
Catch ex
As Exception
MessageBox.Show(ex.Message)
End Try
con.Close()