不好意思,是我犯错了,没有把引用设成本地复制
- using System.Data;
- using System.Web.UI;
- using GrapeCity.ActiveAnalysis.DataSources;
- using GrapeCity.ActiveAnalysis.Schema;
- using GrapeCity.ActiveAnalysis.Silverlight.Server;
- namespace ServerSideDSinSilverlight.Web
- {
- public partial class TestPage : Page
- {
- static TestPage()
- {
- ServerDataSourceManager.Register("abc", CreateDataSource);
- }
- public static GrapeCity.ActiveAnalysis.DataSources.IDataSource CreateDataSource(string input)
- {
- RdDataSource rd = new RdDataSource();
- rd.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\My Documents\GrapeCity\ActiveAnalysis\DataSources\NWind\NWind.mdb;";
- rd.ConnectionType = GrapeCity.ActiveAnalysis.DataSources.ConnectionType.OleDb;
- rd.CustomSchemaFile = @"D:\My Documents\GrapeCity\ActiveAnalysis\DataSources\NWind\NwindMDB-SalesProductsSuppliers.schema";
- rd.QueryString = @"SELECT c.CategoryName, p.ProductName, o.OrderID, o.OrderDate, d.UnitPrice, d.Quantity, s.Country AS SupplierCountry,
- s.City AS SupplierCity, s.CompanyName AS SupplierCompany, m.Country AS CustomerCountry, m.City AS CustomerCity, m.CompanyName AS CustomerCompany,
- d.Discount, m.Region AS CustomerRegion, s.Region AS SupplierRegion, e.LastName, e.EmployeeID AS EmployeeID, e.Title AS EmployeeTitle,
- e.Region AS EmployeeRegion, e.Country AS EmployeeCountry, e.City AS EmployeeCity, o.Freight, o.ShipName, o.ShipVia, o.ShipCity, o.ShipRegion, o.ShipCountry
- FROM Suppliers AS s INNER JOIN ((Categories AS c INNER JOIN Products AS p ON c.CategoryID = p.CategoryID) INNER JOIN (Employees AS e INNER JOIN
- (Customers AS m INNER JOIN (Orders AS o INNER JOIN [Order Details] AS d ON (o.OrderID = d.OrderID) AND (o.OrderID = d.OrderID) AND
- (o.OrderID = d.OrderID)) ON m.CustomerID = o.CustomerID) ON e.EmployeeID = o.EmployeeID) ON p.ProductID = d.ProductID) ON s.SupplierID = p.SupplierID";
- return rd;
- }
- }
- }
复制代码
- <my:PivotView x:Name="PivotView" >
- <my:PivotView.DataSource>
- <DS:ServerSideDataSource DataSourceId="abc"/>
- </my:PivotView.DataSource>
- </my:PivotView>
复制代码 上面是我的代码,都是照着帮助文档里面弄的,但是报错,
服务器报错异常:invalid data source factory identifier,参数名:id |