问题描述
Hello All
我需要下面列出的方法的解决方案是C#......正在将VB代码翻译成C#
以下是我的VB代码
SELECT CASE 请求( output)
CASE xml
rs。读取()
WriteXMLResponse(rs)
CASE excel
WriteExcelResponse(rs)
CASE label
WriteLabelResponse(rs)
CASE html
WriteHtmlResponse(rs)
CASE ELSE
END SELECT
这是我的C#代码
switch (请求[ 输出])
{
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 ;
默认:
break ;
}
错误:
WriteExcelResponse(ref rs);
WriteLabelResponse(ref rs);
WriteHtmlResponse(ref rs);
当前上下文中不存在名称WriteExcelResponse。
当前上下文中不存在名称'WriteLabelResponse'。
当前上下文中不存在名称'WriteHtmlResponse'。
你们都被要求帮我解决一下
Hello All
I need solution for below listed methods is C#......As am translating VB code to C#
Below is my VB Code
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
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
这篇关于在VB中使用C#中的WriteHtmlResponse方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!