读书人

web Service的外部方法想包括DataSe

发布时间: 2012-12-18 12:43:41 作者: rapoo

web Service的外部方法,想包—ataSet参数怎么处理?

我有一个webservice,里面包括方法makeCSV

[WebMethod (Description="CSV文件作成")]
public String MakeCsvFile(String FilePath)
{
InBLL ib = new InBLL();
String last="OK!!!";
int flag=ib.MessageBLL(FilePath);

if(flag==0){last="wrong!!!";}
return last;
}

现在我想给makeCSV方法传一个 Dataset类型的参数,想变成下面这样

[WebMethod (Description="CSV文件作成")]
public String MakeCsvFile(String FilePath,DataSet ds)
{
InBLL ib = new InBLL();
String last="OK!!!";
int flag=ib.MessageBLL(FilePath);

if(flag==0){last="wrong!!!";}
return last;
}


结果出错。不能传DataSet或SqlDataReader类型的参数。
请高手指点

[最优解释]
web Service里面只能用于 基元类型作为参数的方法
[其他解释]
WebService里面的参数弄成string,然后解析成dataset吧

读书人网 >Web Service

热点推荐