问题
Is there an easy way to get the connection string of a database listed in the connection window of LINQPad (other than using the object explorer of Visual Studio)?
回答1:
Making sgmoore's comment into an answer:
try this.Connection.ConnectionString.Dump();
回答2:
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;
来源:https://stackoverflow.com/questions/25360921/how-can-i-get-the-connection-string-for-an-sql-express-database-listed-in-linqpa