
| Visual Basic (Declaration) | |
|---|---|
Public NotInheritable Class RdDataSource Inherits DataSourceBase Implements IDataSource, IPersistLocalCube, IPersistXmlSettings, GrapeCity.ActiveAnalysis.Schema.ISchemaFactoryProvider | |
| C# | |
|---|---|
public sealed class RdDataSource : DataSourceBase, IDataSource, IPersistLocalCube, IPersistXmlSettings, GrapeCity.ActiveAnalysis.Schema.ISchemaFactoryProvider | |
You should use this class to analyze data from a relational database or a text file in the CSV format. It is possible to choose one of the available data providers (OLEDB, SQL or ODBC) using the ConnectionType property. A cube schema file is required to use the
RdDataSource class. For more information, see the CustomSchemaFile property. The RdDataSource class allows to save the currently analyzed data to a file that can be later loaded, using the LocalCubeDataSource class. You can analyze such local cubes without establishing a connection to a source data base.
The following code sample demonstrates how to set up a connection to a relational data store.
| C# | Copy Code |
|---|---|
RdDataSource rdDataSource = new RdDataSource(); rdDataSource.ConnectionType = ConnectionType.OleDb; rdDataSource.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=NWind\nwind.mdb;"; rdDataSource.CustomSchemaFile = "NwindMDB-SalesProductsSuppliers.schema"; rdDataSource.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;"; rdDataSource.Connect(); pivotView.DataSource = rdDataSource; | |
System.Object
GrapeCity.ActiveAnalysis.DataSources.DataSourceBase
GrapeCity.ActiveAnalysis.DataSources.RdDataSource
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2