现在的位置: 首页 > 综合 > 正文

npgsql 0.7beta3 的一个Bug (submitted)

2011年02月24日 ⁄ 综合 ⁄ 共 1329字 ⁄ 字号 评论关闭
Summary: Parameters property of Command class doesnot support indexing by column name (ID: 1106)
Bug Type: Software bug
Severity: Serious
Software Version: 0.7beta3
Environment:

OS: windows 2003

DB:PostgreSQL 8.0.0-rc1

npgsql Package:Npgsql0.7beta3-bin

Description:

Parameters property of Command class doesnot support indexing by column name.

When I use these everything is okey:

IDbDataParameter idbPrmtr = cmd.Parameters[0] as IDbDataParameter;

...

But throw exception (System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.) when:

IDbDataParameter idbPrmtr = cmd.Parameters["ACertainColumnName"] as IDbDataParameter;

Exception detail:

---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

at System.Collections.ArrayList.get_Item(Int32 index)

at Npgsql.NpgsqlParameterCollection.System.Data.IDataParameterCollection.get_Item(String parameterName)

at KampSln.DataAccess.DataBaseInfo.PutDataToDb(Int32 toDbObjIndex, DataTable data, String toTableName) in c:\documents and settings\v-kaiboh\my documents\visual studio projects\itemmaintainment\dataaccess\databaseinfo.cs:line 551

--- End of inner exception stack trace ---

Another error:

IDbDataParameter idbPrmtr = cmd.Parameters[0] as IDbDataParameter;

is okey but

cmd.Parameters[0].Value = 1;

will throw an exception and say 'does not support index'.

¤Link:

 Bug report site

【上篇】
【下篇】

抱歉!评论已关闭.