悬赏园豆:5
[已解决问题]
解决于 2008-01-15 10:01
<P>第一:大家说说你们在用webservices时一般用什么作为返回类型 ?</P>
<P>DataSet,<FONT color=#000000>XmlDataDocument,数组或者是结合类型呢?</FONT></P>
<P><FONT color=#000000>第二,下面的这段代码,在性能上是否有区别?</FONT></P>
<P>public <FONT color=#00ff00>DataSet</FONT>/ <FONT color=#ff0000>XmlDataDocument</FONT> GetSiteAData(string AssignName)<BR> {<BR> DataSet dsNorthwind = new DataSet(); <BR> String sConnect;<BR> sConnect = "Password=luowen;User ID=sa;database=bbs;Data Source=192.168.18.120";<BR> SqlConnection nwconnect = new SqlConnection(sConnect);<BR> String sCommand = "select * from bbs_link";<BR> SqlDataAdapter myDataAdapter = new SqlDataAdapter(sCommand, nwconnect);<BR> myDataAdapter.Fill(dsNorthwind, "link");<BR> <FONT color=#ff0000>//XmlDataDocument doc = new XmlDataDocument(dsNorthwind);<BR> //doc.Save(Console.Out);<BR> //if (true) //如果执行成功,存储过程<BR> //{<BR> // XmlNode root1 = doc.DocumentElement;<BR> // XmlNodeList roots = root1.SelectNodes("list");<BR> // foreach (XmlNode roota in roots) //为所有元素加上站点名称标记<BR> // {<BR> // XmlElement Link = doc.CreateElement("SiteName");<BR> // Link.InnerText = ConfigurationManager.AppSettings["SiteName"].ToString();<BR> // roota.AppendChild(Link);<BR> // }<BR> // return doc;<BR> //}<BR> //else<BR> // return null;</FONT><BR> <FONT color=#00ff00>return dsNorthwind;</FONT><BR> }</P>
<P> </P>
伊牛娃
|
菜鸟二级
|
园豆:
207
提问于:2008-01-11 11:36