【发布时间】:2008-12-30 15:07:40
【问题描述】:
如何从网络服务中获取对象:
[网络方法] 公共数据集 GetVendors(字符串数据库) { SqlConnection sqlConn = new SqlConnection();
sqlConn.ConnectionString = GetConnString(Database);
// build query
string strSQL = @" SELECT [No_] AS [VendorNo],
LTRIM([Name]) AS [VendorName]
FROM [********_$Vendor]
WHERE LEN(RTRIM([Name])) > 0 /* avoid blank names */
AND [Vendor Posting Group] = 'VEND'
ORDER BY LTRIM([Name]) ASC; /* LTRIM fixes spaces before name */ ";
SqlDataAdapter da = new SqlDataAdapter(strSQL, sqlConn);
DataSet ds = new DataSet();
da.Fill(ds, "Vendors");
return (ds);
}
【问题讨论】:
标签: sql web-services