DataReader ordinal-based lookups vs named lookups

前端 未结 4 1751
一个人的身影
一个人的身影 2020-12-18 06:34

Microsoft (and many developers) claim that the SqlDataReader.GetOrdinal method improves the performance of retrieving values from a DataReader versus using named lookups ie.

4条回答
  •  有刺的猬
    2020-12-18 07:16

    Any difference will be more than outweighed by maintenance overhead.

    If you have that much data that it makes a noticeable difference, I'd suggest you have too much data in your client code. Or this is when you consider use ordinals rather than names

提交回复
热议问题