Reputation: 1144
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)?
Upvotes: 9
Views: 5533
Reputation: 620
In LINQPad 8 you no longer have access to this.Database
as suggested by other answers, but you can do simply:
this.Connection.ConnectionString
Alternatively and even more simply, you can use:
Util.CurrentCxString
This also works in a static context where this
is unavailable.
Upvotes: 0
Reputation: 8351
In LinqPad7 you do:
this.Database.GetDbConnection().ConnectionString
This will show you the connection string.
Upvotes: 0
Reputation: 312
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;
Upvotes: 4
Reputation: 4713
Making sgmoore's comment into an answer:
try this.Connection.ConnectionString.Dump();
Upvotes: 17