且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将每条记录从查询结果转换为数组

更新时间:2023-02-14 10:55:55

你好亲爱的朋友。你可以使用它:



Hello dear friend.you can use this :

List<object> Items = new List<objects>();
foreach(object item in reservation)
    Items.add(item);
</objects></object>





您可以为表格的数据建立一个模型,您可以投放< item>的每个项目。列入该模型,如



You can make a model for your table's data which you can cast each items of <item> list into that model like

MyModel myModel = Items<n> as MyModel;</n>





您可以像这样使用Array而不是List:



You can use Array instead of List like this :

object[] Items = new object()[int.Max];





我希望它可以帮到你。



I hope it can help you.