How to change Vb.net GetType(String) to C# code

  • Thread starter Thread starter karunakar
  • Start date Start date
K

karunakar

this is vb.net CODE :

string msParcoWebSvc = mappConfig.GetValue("ParcoWebServiceURL",
GetType(String)).ToString

How to change code in C# :

I was done like this but iam getting error:

string msParcoWebSvc = mappConfig.GetValue("ParcoWebServiceURL",
GetType()).ToString();

An unhandled exception of type 'System.InvalidOperationException' occurred
in system.dll

Additional information: Type 'Parco.Form1' does not have a Parse method.

Regards

Karunkara Rao
 
The C# equivalent to VB's global GetType function is "typeof".

Your C# code should be:
string msParcoWebSvc = mappConfig.GetValue("ParcoWebServiceURL",
typeof(string)).ToString();

Please download the Demo Edition of our Instant C# VB.NET to C# converter at
www.instantcsharp.com to easily obtain these comparisons.

David Anton
Tangible Software Solutions Inc.
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# converter and the Instant VB C# to
VB.NET converter
 
Back
Top