Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get current connected database file path?

Tags:

People also ask

How do I find my database path?

If you ever need to know where your database files are located, run the following T-SQL code: USE master; SELECT name 'Logical Name', physical_name 'File Location' FROM sys. master_files; This will return a list of all data files and log files for the SQL Server instance.

How do I find the path to sqlite?

To get the path of Sqlite data base here I am writing two ways to get the path. File path=context. getDatabasePath("YourDbName"); String db_path=path. getAbsolutePath(); Log.

Where can I find MDF and LDF files?

The mdf and ldf can be set for each Microsoft SQL database, by right-clicking on the database, in Microsoft SQL Server Management Studio and selecting Properties. In the Database Properties Select Files. In this window, the current settings for the mdf and ldf are displayed.


I am developing a web application. I need to get the database file path. What's the way to get the database file path in c#? for example:

E:/Program Files/Microsoft SQL Server/MSSQL.1/MSSQL/Data/MyDatabase.mdf