like this
your connection string is like conn
sqlcommand cmd = sqlcommand("create database your name",conn);
conn.open();
cmd.excutenonquery();
it will automatically through error if database is already exists
and if database is not there it will create database.
same procedure for create tables also.
if any issue ask again.