As you already aware how to run SQL query from VB.net , I am giving you two queries for checking table existance
select * FROM sys.databases WHERE name='DB1'
SELECT * FROM sys.tables WHERE name='TB1'
Below are codes for VB.Net
Dim conStr As String = "Server=.;Database=;Trusted_Connection = yes;MultipleActiveResultSets=True;"
Dim objCon As New SqlConnection(conStr)
Dim obj As SqlCommand
Dim strSQL As String
Dim myReader As SqlDataReader
objCon.Open()
obj = objCon.CreateCommand()
Try
strSQL = "SELECT * FROM sys.databases WHERE name='INDRA'"
obj.CommandText = strSQL
SET myReader=obj.ExecuteReader()
IF NOT myReader.Read()
strSQL = "CREATE DATABASE INDRA"
obj.CommandText = strSQL
obj.ExecuteNonQuery()
MsgBox("Database Created Successfully...", MsgBoxStyle.Information, "Indranil Chatterjee..")
END IF
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Do the same thing for table creation
Hope this helps if yes then accept and vote this solution otherwise revert back with your queries
--RDB