Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67441

How to display database name from connectionStrings onto my webpage for development purpose?

$
0
0

For development purposes I want to display the database it is connected to since I have 1 for development and 1 for production use. How do I do that using either Javascript, html or c#?

Right now I am connected via c#

 protected MysqlDbContext db = new MysqlDbContext();
 public class MysqlDbContext: DbContext
 {
     public MysqlDbContext() : base("MysqlDbContext")
     {
     }
 }

 var a = db.Database.Connection.Database.ToString(); //returns me the database name

So how can I access the a from my cshtml file?


Viewing all articles
Browse latest Browse all 67441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>