连接 Office 数据连接
Connect with Office Data Connection
我有一个 Excel .odc 文件,它定义了一个 OLEDB 连接,如下所示:
Provider=MSOLAP.5;
Integrated Security=SSPI;
Persist Security Info=True;
User ID="";
Initial Catalog="";
Data Source=xxx.xxx.com\tabular;
Location=xxx.xxx.com\tabular;
MDX Compatibility=1;
Safety Options=2;
MDX Missing Member Mode=Error
我可以使用这个在 C# 中使用 SqlConnection 打开数据库吗?
除了 Office Interop(实际上是打开 Excel 的一个实例)、Office 加载项(Excel 已经打开,代码作为宏),或 Reporting Services + Sharepoint 使用 *.odc
文件连接到数据库。您将必须编写自己的代码来打开文件,解析连接字符串的值,并使用该字符串连接到数据库。
大家去写这段代码的时候注意:ODC是not-quite valid XML.
我有一个 Excel .odc 文件,它定义了一个 OLEDB 连接,如下所示:
Provider=MSOLAP.5;
Integrated Security=SSPI;
Persist Security Info=True;
User ID="";
Initial Catalog="";
Data Source=xxx.xxx.com\tabular;
Location=xxx.xxx.com\tabular;
MDX Compatibility=1;
Safety Options=2;
MDX Missing Member Mode=Error
我可以使用这个在 C# 中使用 SqlConnection 打开数据库吗?
除了 Office Interop(实际上是打开 Excel 的一个实例)、Office 加载项(Excel 已经打开,代码作为宏),或 Reporting Services + Sharepoint 使用 *.odc
文件连接到数据库。您将必须编写自己的代码来打开文件,解析连接字符串的值,并使用该字符串连接到数据库。
大家去写这段代码的时候注意:ODC是not-quite valid XML.