sql - VB.net Checking if database exists before connecting to it -
i found following query in order find out if database table created or not: if db_id('thedbname') not null --code mine :) print 'db exists' else print 'nope' now wanting use same query within vb.net application. code have elsewhere connects database (that wanting see if there before doing this): dim cn sqlconnection = new sqlconnection("data source=davidsdesktop;" & _ "initial catalog=thedbname;" & _ "integrated security=true;" & _ "pooling=false") dim sql string = "if db_id('thedbname') not null " & vbcrlf & _ "print() 'exists' " & vbcrlf & _ "else " & vbcrlf & _ "print() 'nope'" dim cm...