J
Jim in Arizona
I've been using VB 2005 for a few years now. My entire coding history is
VB related.
This weekend I decided to start learning C#. I'm at work now and decided
to do some coding in C# that I would normally do in VB. I'm running into
various 'small' difficulties.
I don't understand this:
In vb, this is valid:
Dim strConnection as string
strConnection = ConfigurationManager.AppSettings("miscellaneous")
But, when I attempt to do similar with C#:
string strConnection;
strConnection = ConfigurationManager.AppSettings("miscellaneous");
I don't get any errors during design time. When I save the page (and
code behind), and attempt to load it, I get this error:
Compiler Error Message: CS0118:
'System.Configuration.ConfigurationManager.AppSettings' is a 'property'
but is used like a 'method'
How should it go then?
TIA,
Jim
VB related.
This weekend I decided to start learning C#. I'm at work now and decided
to do some coding in C# that I would normally do in VB. I'm running into
various 'small' difficulties.
I don't understand this:
In vb, this is valid:
Dim strConnection as string
strConnection = ConfigurationManager.AppSettings("miscellaneous")
But, when I attempt to do similar with C#:
string strConnection;
strConnection = ConfigurationManager.AppSettings("miscellaneous");
I don't get any errors during design time. When I save the page (and
code behind), and attempt to load it, I get this error:
Compiler Error Message: CS0118:
'System.Configuration.ConfigurationManager.AppSettings' is a 'property'
but is used like a 'method'
How should it go then?
TIA,
Jim