gpt4 book ai didi

c# - 多步 OLE DB 操作产生的错误

转载 作者:行者123 更新时间:2023-11-30 16:35:05 25 4
gpt4 key购买 nike

我正在从 Netezza 数据源运行一个简单的 FillSchema

dss = new DataSet();
ad = new OleDbDataAdapter(cmd);
ad.SelectCommand = new OleDbCommand("SELECT * FROM " + objTable.name);
ad.SelectCommand.Connection = cn;
ad.FillSchema(dss, SchemaType.Source);

我收到以下错误:

System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillSchemaInternal(DataSet dataset, DataTable datatable, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillSchema(DataSet dataSet, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillSchema(DataSet dataSet, SchemaType schemaType)
at IMS.DF2.IMSCubeGenerator.IMSCube.AddTableToDatasourceView(table objTable) in C:\DIUP\DF2\IMSCubeGenerator\IMSCube.cs:line 902

我在这里做错了什么?

我怎样才能找到下面的错误(检查每个 OLE DB 状态值)?

最佳答案

你的连接字符串是什么?

它将是您的驱动程序、光标或安全性(我在使用集成安全性时遇到了同样的问题)。

将其更改为用户名/密码解决了我的问题。

参见 here , herehere了解更多信息。

关于c# - 多步 OLE DB 操作产生的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2142638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com