Click here to Skip to main content
15,895,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All

I need solution for below listed methods is C#......As am translating VB code to C#

Below is my VB Code

SQL
SELECT CASE Request("output")
           CASE "xml"
               rs.Read()
               WriteXMLResponse(rs)

           CASE "excel"
               WriteExcelResponse(rs)

           CASE "labels"
               WriteLabelResponse(rs)

           CASE "html"
               WriteHtmlResponse(rs)

           CASE ELSE
        END SELECT


Here is my C# code

C#
switch (Request["output"])
      {
          case "xml":
              rs.Read();
              WriteXMLResponse(ref rs);

              break;
          case "excel":

              WriteExcelResponse(ref rs);

              break;
          case "labels":
              WriteLabelResponse(ref rs);
              break;

          case "html":
              WriteHtmlResponse(ref rs);

              break;
          default:
              break;
      }


Error:
WriteExcelResponse(ref rs);
WriteLabelResponse(ref rs);
WriteHtmlResponse(ref rs);

The name 'WriteExcelResponse' does not exist in current context.
The name 'WriteLabelResponse' does not exist in current context.
The name 'WriteHtmlResponse' does not exist in current context.

You all are requested to help me to sort it out
Posted
Updated 14-Jun-15 21:29pm
v2

That simply means that you have to translate those three functions also.
 
Share this answer
 
The functions are not system functions. They must be custom methods in your c# code somewhere.

Try right-clicking the method name and click "go to definition" from the context menu. You will then have to write these methods into VB functions before you can call them.

Also, take a look at this: http://converter.telerik.com/[^]
It's handy for converting simple functions from c# to vb and back
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900