How can I get the connection string for an SQL Express database listed in LINQPad? How can I get the connection string for an SQL Express database listed in LINQPad? database database

How can I get the connection string for an SQL Express database listed in LINQPad?


Making sgmoore's comment into an answer:

try this.Connection.ConnectionString.Dump();


In LinqPad 5 if your Language dropdown is set to C# Program and you have a database selected in the Connection dropdown, then you can get your string using

string c = LINQPad.Util.CurrentDataContext.Connection.ConnectionString;