日期:2014-05-17  浏览次数:20475 次

用微软数据库的简单例子源代码复制进去,怎么还会出现错误的啊

using System;
using Microsoft.ReportingServices.Interfaces;
using GetPropertiesSample.ReportService2005;


namespace GetPropertiesSample
{
    class Program
    {
        static void Main(string[] args)
        {
          
           ReportingService2005 rs = new ReportingService2005();//怎么这里老是提示找不到,要添加引用???
            rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
            rs.Url = "http://localhost/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(
                "/Tutorial/Sale Orders", properties);

                foreach (Property p in returnProperties)
                {
                    Console.WriteLine(p.Name + ": " + p.Value);
                }

            }

            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}

------解决方案--------------------
貌似不是sql server?
是C语言的,建议去C版.
------解决方案--------------------
数据库连接对象设置了吗?
------解决方案--------------------

--建议去c#版块问问
c#
go

------解决方案--------------------