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

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top