How can I convert database query results to an array?

前端 未结 4 604
一向
一向 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:07

    You can use List enter code here instead of array to store your data where T is the type of data you want to store e.g. string, int or your custom data type. For using Arrays, we need to specify the length at compile time but with List we can store data without worrying about the length.

提交回复
热议问题