Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can we get connected database name from vb.net application
Posted
Comments
Simon_Whale 10-Apr-15 7:04am    
could you not manipulate the connectionstring?

Try asking SQL:
SQL
SELECT DB_NAME()
 
Share this answer
 
Please, see: SqlConnection.Database Property [^] - gets the name of the current database or the database to be used after a connection is opened.

For OleDb: OleDbConnection.Database Property [^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900