您的位置:首页 > 数据库

npgsql 0.7beta3 的一个Bug (submitted)

2004-12-30 11:19 351 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: