First, check the SQL Server instance to see if the DB is there: that's pretty easy, you can get a list of all DB's from SQL like this:
Using con As New SqlConnection("Data Source=GRIFFPC\SQLEXPRESS;Integrated Security=True")
con.Open()
Using cmd As New SqlCommand("sp_databases", con)
cmd.CommandType = CommandType.StoredProcedure
Dim read As SqlDataReader = cmd.ExecuteReader()
While read.Read()
Console.WriteLine(DirectCast(read("DATABASE_NAME"), String))
End While
End Using
End Using
If your DB is in the list, it exists. Sorted.
If it isn't, then you need to create it: and the easiest way is to put the SQL commands into a file, and send that to the new SQL instance as a command string - SSMS will generate the file for you (complete with a minimum or sample set of data if needed).
Where to put it? Well - that's a good question! Creating the DB could take some time, so you want it to happen when the user can see that something is going on. Myself, I'd create a small "Initializing" form which is run by the startup form as a modal dialog and which shows the user what is happening, and only returns when the DB is ready to rock'n'roll. (I'd also run the code in a background worker within that form so that the UI remains responsive)