下面是訪問web的一個程序 大概樣子
其中ReportingService2005 rs = new ReportingService2005();這個創(chuàng)建的實例是怎么回事
“未能找到類型或命名空間名稱 reportingService2005 是什么??????”
人太淺薄
?using System;
using GetPropertiesSample.ReportService2005;
static void Main(string[] args)
{
ReportingService2005 rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
rs.Url = http://<Server Name>/reportserver/reportservice2005.asmx;
Property name = new Property(); name.Name = "Name";
Property description = new Property();
description.Name = "Description";
Property[] properties = new Property[2];
properties[0] = name; properties[1] = description;
try {
Property[] returnProperties = rs.GetProperties( "/AdventureWorks 2008 Sample Reports/Company Sales 2008",properties);
foreach (Property p in returnProperties)
{
Console.WriteLine(p.Name + ": " + p.Value);
}
} catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
1 回答

四季花海
TA貢獻(xiàn)1811條經(jīng)驗 獲得超5個贊
如果你建立的ReportService2005是個項目GetPropertiesSample里的類,不能用using GetPropertiesSample.ReportService2005;應(yīng)該為using GetPropertiesSample;
如果你確定GetPropertiesSample.ReportService2005是個命名空間的話,要保證空間里有ReportService2005這個類,
不知道項目里是否添加了引用GetPropertiesSample.ReportService2005
?
- 1 回答
- 0 關(guān)注
- 323 瀏覽
添加回答
舉報
0/150
提交
取消