我正在尝试在DataConnectionDialog中添加SAP Hana提供程序,但是无法添加它 可以请任何人帮我添加吗?
bool TryGetDataConnectionStringFromUser(out string outConnectionString)
{
using (var dialog = new DataConnectionDialog())
{
//Mohan: Function is used for making connection string with Sage300 and return Connection string
// If you want the user to select from any of the available data sources, do this:
DataSource.AddStandardDataSources(dialog);
dialog.DataSources.Add(DataSource.SqlDataSource);
dialog.DataSources.Add(DataSource.OracleDataSource);
DataSource db = new DataSource("SAPHana", "SAP Hana");
dialog.DataSources.Add(db);
// The way how you show the dialog is somewhat unorthodox; `dialog.ShowDialog()`
// would throw a `NotSupportedException`. Do it this way instead:
DialogResult userChoice = DataConnectionDialog.Show(dialog);
// Return the resulting connection string if a connection was selected:
if (userChoice == DialogResult.OK)
{
outConnectionString = dialog.ConnectionString;
return true;
}
else
{
outConnectionString = null;
return false;
}
}
}
我已经通过链接了
但是当我用我的代码使用时,它不会出现。 预先感谢。