SqlDataReader are these two the same Which one is faster

后端 未结 3 905
小蘑菇
小蘑菇 2021-01-20 00:45

I am working with SqlXml and the stored procedure that returns a xml rather than raw data. How does one actually read the data when returned is a xml and does not know about

3条回答
  •  余生分开走
    2021-01-20 00:49

    Indexer method is faster because it returns data in native format and uses ordinal.

    Have a look at these threads:

    1. Maximize Performance with SqlDataReader
    2. .NET SqlDataReader Item[] vs. GetString(GetOrdinal())?

提交回复
热议问题