ConfigurationElementCollection and Linq

Okay, given that it’s all weakly typed, you’ll need to either call Cast<> or OfType<> explicitly, or give an explicit type to the range variable. You’ll also need to specify the ServerCollection property on your ServerDetails. For example:

ServerDetails servers = (ServerDetails) ConfigurationManager.GetSection("serverDetails");
var server = from ServerElement s in servers.ServerCollection
             where s.Name == serverName
             select s;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)