npgsql 0.7beta3 的一個Bug (submitted)

來源:互聯網
上載者:User
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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.