Fill an array (or arraylist) from SqlDataReader

Viewed 92643

Is there a way to fill an array via a SqlDataReader (or any other C# ADO.NET object) without looping through all the items? I have a query that is returning a single column, and I want to put that into a string array (or ArrayList, or List, etc).

8 Answers
var array = reader.GetValue("field_name") as long[];
Related