How can I convert database query results to an array?

前端 未结 4 603
一向
一向 2021-01-23 07:59

How would I convert the results returned in a MySQL query to an array in C# .Net/Mono

To my understanding you need to define arrays with the number of items the array wi

4条回答
  •  余生分开走
    2021-01-23 08:23

    Expanding on @Deepansh Gupta's response: You might consider creating a custom object or structure whose internal data fields correspond to the columns returned in your query result set (i.e., each object corresponds to a data row, each data variable in the object corresponds to columnar data). As your code goes through each row of the results, create a new custom object and append it to your List.

提交回复
热议问题