开发者

How can I use ref in WCF?

Can't I use ref in WCF to return data ?

This is my WCF file.

public myDataset SearchInfo(string accountName, string accountId, ref int totalRecords)

Although totalRecords is a non-zero number, I always get 0. I have to get both myDataset and totalRecords. 开发者_如何学PythonHow should I try? I am new to WCF.

Thanks in advance.

UPDATE :

It works well. My bad !!!


If you're trying to return multiple values, it's probably better to add a data contract with a data member for each value (dataset and total records in your case).

[DataContract]
public class SearchInfoResult
{
  [DataMember]
  public myDataSet DataSet {get; set;}

  [DataMember]
  public int TotalRecords {get; set;}
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜