c# - Use Linq to iterate over ConfigurationManager.ConnectionStrings? -
is possible this?
var strings = configurationmanager.connectionstrings; var names = (from d in strings select new connectionname(d.name));
yes, because connectionstrings
not implement typed ienumerable
, have tell linq type collection contains.
use either from connectionstringsettings d in strings
or configurationmanager.connectionstrings.cast<connectionstringsettings>()
.
Comments
Post a Comment