Hi VijayDhas,
You can check by executing this query in sql server
if db_id('master') is not null
print 'db exists'
else
print 'Not exists'
Will give output as
db exists
If you want to check it from C# then refer this
link[
^].You will get some idea to check the existence of database from C#.
Hope this helps you a bit.
Regards,
RK