Create a new database programatically?
Thanks,
--Mable
Thanks,
--Mable
I may not be fully understanding the issue...
BobP
Hi,
Just make a connection to the master database of a SqlServer. This database is default to every instance of SqlServer so you don't have to worry on checking. After, connecting just execute a t-sql CREATE DATABASE commands to create a database using a SqlCommand...
cheers,
Paul June A. Domag
--Mable
First, connecto to the master database using a SqlConnection objejct. Then Execute the T-Sql with SqlCommand Object. I haven't personally tried it but I think t-sql could be used in sqlexpress...
Dim sqlCon As New SqlConnection("Password=;Persist Security Info=True;User ID=sa;Initial Catalog=master;Data Source=local")
sqlCon.Open()
Dim cmd As New SqlCommand("CREATE DATABASE dbase1", sqlCon)
cmd.ExecuteNonQuery()
Ypu can the connect to the database that you created and create your tables.
cheers,
Paul June A. Domag
I could have read Help files for a month and not figured this out. Thanks for taking the time to help out a stranger.
--Mable