c# - Fill generic list from SqlDataReader

前端 未结 5 1866
轮回少年
轮回少年 2021-02-14 02:23

How can I add values that a SqlDataReader returns to a generic List? I have a method where I use SqlDataReader to get CategoryID from a

5条回答
  •  余生分开走
    2021-02-14 02:54

    Your current code should work, assuming catID is really declared before the try block, otherwise this won't compile.

提交回复
热议问题