views:

618

answers:

4

Hi,

I am facing problems in converting code from VB to C# / .NET. The database backend is Access.

Thanks in advance, Mahesh

+1  A: 

Kamal Patel has created a simple tool to help you convert your code. There's on online version and a downloadable version too ($199 though). It isn't 100%, nor can it be, but it really helps!

Demo version

This is only VB.NET->C#, the original app is old-school VB, I believe.
Cody Brocious
Also, I get "Server Error in '/' Application." error with the demo..
Optimal Solutions
+1  A: 

You can open the VB assembly in Reflector with the FileDisassembler plug-in, and have it save the code in the language you want.

EDIT: Sorry, I misread. The above will only work for VB.NET code. For old VB I guess there's only the commercial solution.

hmemcpy
This is only VB.NET->C#, the original app is old-school VB, I believe.
Cody Brocious
Oh, sorry, I misread...
hmemcpy
A: 

You could use Telerik's excellent CodeChanger Service

"Code Converter is a free and simple VB to C# and C# to VB code converter. While there are several other good code converters available, none are perfect. Some are buried in busy websites. Some are awkward to use. Some just don't convert accurately! Code Converter, while not yet perfect, aims to address these issues and provide the best free .NET converter available on the web."

splattne
As I commented on hmemcpy and Jasper's answers, I believe this is .NET-only, whereas the original app was plain VB.
Cody Brocious
+2  A: 

As far as I know, there is no direct and reliable way to go from VB6 (assuming you're "VB" means VB6) to C#. You may want to go from VB6 -> VB.NET and then you can try to google for tons of resources on converting VB.NET to C#. Its not going to be a perfectly smooth road, however. Test, test, test.

Optimal Solutions