用微软数据库的简单例子源代码复制进去,怎么还会出现错误的啊using Systemusing Microsoft.ReportingServ
用微软数据库的简单例子源代码复制进去,怎么还会出现错误的啊
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
------解决方案--------------------
单纯看代码是没什么问题的
[解决办法]
别急.学程序设计都是这么过来的.仔细查查,看出了什么问题.
[解决办法]
3.在“Web 引用名”框中,将 Web 引用重命名为 ReportService2005,这是将用于该 Web 引用的命名空间。
这个做了吗?
[解决办法]
版本改了,有些程序语句要改变
