0
[ServiceContract]
public interface Idemo
{
[OperationContract]
[WebGet(UriTemplate = "check?Value1={id}&Value2={name}&Value3={city}",
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Bare)]
string GetData(string id,string name);
}
類
public class demo : Idemo
{
public string GetData(string id,string name,string city)
{
DataTable tb;
tb = con.GetDataTable("query");
tb.TableName = "data";
System.IO.StringWriter writer = new System.IO.StringWriter();
tb.WriteXml(writer, XmlWriteMode.IgnoreSchema, false);
return writer.ToString();
}
}
返回表看起來像下面
sem sub1 sub2 sub3
1 50 40 30
2 60 20 40
是界面設計好?我沒有使用任何合同。有沒有其他方法可以加速?
我聽說將DataSet轉換成一個自定義的DataContract併發送它..在我的場景中可能嗎?
你爲什麼要加快速度?你確定它太慢了嗎? – GManNickG 2013-03-02 08:45:30