我写了一个webservice的调用,代码如下
[WebMethod(Description = "加载用户数据")]
public DataSet DatasLoaded(string Uname,string Upassword)
{
DataSet ds = new DataSet();//数据集
string sqldlusers = string.Format("SELECT * FROM info INNER JOIN Note ON info.Uname = Note.Uname INNER JOIN Things ON info.Uname = Things.Uname AND info.Uname='{0}'and info.Password='{1}'", Uname, Upassword); //加载用户信息
try
{
SqlDataAdapter sdaUserDatas = new SqlDataAdapter(sqldlusers, DBHelper.Connection);
sdaUserDatas.Fill(ds);
return ds;
}
catch (Exception ex)
{
return null;
}
finally
{
DBHelper.Connection.Close();
}
}
但是返回的XML如下
<?xml version="1.0" encoding="UTF-8"?>
-<DataSet xmlns="http://www.myworksoft.com/"> -<xs:schema xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="NewDataSet"> -<xs:element msdata:UseCurrentLocale="true" msdata:IsDataSet="true" name="NewDataSet"> -<xs:complexType> -<xs:choice maxOccurs="unbounded" minOccurs="0"> -<xs:element name="Table"> -<xs:complexType> -<xs:sequence> <xs:element name="Uname" minOccurs="0" type="xs:string"/> <xs:element name="Password" minOccurs="0" type="xs:string"/> <xs:element name="Email" minOccurs="0" type="xs:string"/> <xs:element name="Uname1" minOccurs="0" type="xs:string"/> <xs:element name="Ncontent" minOccurs="0" type="xs:string"/> <xs:element name="Ndate" minOccurs="0" type="xs:dateTime"/> <xs:element name="Uname2" minOccurs="0" type="xs:string"/> <xs:element name="Bcontent" minOccurs="0" type="xs:string"/> <xs:element name="BSdate" minOccurs="0" type="xs:dateTime"/> <xs:element name="BEdate" minOccurs="0" type="xs:dateTime"/> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> -<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"> -<NewDataSet xmlns=""> -<Table diffgr:id="Table1" msdata:rowOrder="0"> <Uname>wang </Uname> <Password>wang </Password> <Email>wang </Email> <Uname1>wang</Uname1> <Ncontent>a</Ncontent> <Ndate>2010-09-10T18:15:10+08:00</Ndate> <Uname2>wang</Uname2> <Bcontent>没事</Bcontent> <BSdate>1991-12-12T18:12:00+08:00</BSdate> <BEdate>1991-12-12T18:20:10+08:00</BEdate> </Table> -<Table diffgr:id="Table2" msdata:rowOrder="1"> <Uname>wang </Uname> <Password>wang </Password> <Email>wang </Email> <Uname1>wang</Uname1> <Ncontent>没事</Ncontent> <Ndate>2012-09-10T18:11:00+08:00</Ndate> <Uname2>wang</Uname2> <Bcontent>没事</Bcontent> <BSdate>1991-12-12T18:12:00+08:00</BSdate> <BEdate>1991-12-12T18:20:10+08:00</BEdate> </Table> </NewDataSet> </diffgr:diffgram> </DataSet>