【发布时间】:2019-06-23 08:56:10
【问题描述】:
将结构化 ODBC 数据源添加到我的模型会导致错误。
我想使用 Microsoft.AnalysisServices.Tabular 库,使用结构化(即 M / Power Query)、非传统(即 ProviderDataSource)数据源,在兼容级别 1400 的 SQL Analysis Services 服务器上生成表格模型。 我使用 NuGet 包 Microsoft.AnalysisServices.retail.amd64 (16.3.0) 安装了该库。
这是我的数据源定义。
myDatabase.Model.DataSources.Add(new StructuredDataSource()
{
Name = "ODBC",
Description = "An structured ODBC data source definition",
ConnectionDetails = new ConnectionDetails()
{
Protocol = DataSourceProtocol.Odbc
},
Credential = new Credential()
{
AuthenticationKind = AuthenticationKind.UsernamePassword,
EncryptConnection = false,
Username = "MYUSERNAME",
Password = "MYPASSWORD"
}
}
当我运行这段代码时,我得到:
COM error: Microsoft.Data.Mashup; The given data source reference is not a valid data source.
它并没有给我任何指示去哪里看或具体有什么问题。我怀疑定义需要一个服务器地址,但是无法根据文档设置ConnectionDetails对象的地址属性。
ConnectionDetails.Address Property
Address of this connection. It can't be set, instead it should be modified directly.
【问题讨论】:
标签: c# ssas-tabular analysisservices