首页 新闻 赞助 找找看

访问web服务

0
悬赏园豆:5 [已解决问题] 解决于 2016-07-29 12:23

下面是访问web的一个程序 大概样子
其中ReportingService2005 rs = new ReportingService2005();这个创建的实例是怎么回事
“未能找到类型或命名空间名称 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);  
 }
}
李成龙1991的主页 李成龙1991 | 初学一级 | 园豆:79
提问于:2011-07-16 11:44
< >
分享
最佳答案
0

如果你建立的ReportService2005是个项目GetPropertiesSample里的,不能用using GetPropertiesSample.ReportService2005;应该为using GetPropertiesSample;

如果你确定GetPropertiesSample.ReportService2005是个命名空间的话,要保证空间里有ReportService2005这个

不知道项目里是否添加了引用GetPropertiesSample.ReportService2005


 

收获园豆:5
贪心狸猫 | 小虾三级 |园豆:872 | 2011-07-16 12:02
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册