S
shapper
Hello,
I am converting some old code from VB.NET to C# using an online
converter but I still get a few errors:
public static Object Settings() {
return ConfigurationManager.GetSection("BonsAlunos");
}
public static ElementCollection GetAllElements(string section) {
ElementCollection elements =
Settings.GetType().GetProperty(section).GetValue(Settings, null);
return elements;
}
I get the following error:
MyApp.Config.Settings()' is a 'method', which is not valid in the
given context
On code line:
ElementCollection elements =
Settings.GetType().GetProperty(section).GetValue(Settings, null);
What am I doing wrong?
Thanks,
Miguel
I am converting some old code from VB.NET to C# using an online
converter but I still get a few errors:
public static Object Settings() {
return ConfigurationManager.GetSection("BonsAlunos");
}
public static ElementCollection GetAllElements(string section) {
ElementCollection elements =
Settings.GetType().GetProperty(section).GetValue(Settings, null);
return elements;
}
I get the following error:
MyApp.Config.Settings()' is a 'method', which is not valid in the
given context
On code line:
ElementCollection elements =
Settings.GetType().GetProperty(section).GetValue(Settings, null);
What am I doing wrong?
Thanks,
Miguel