开发者

C# best way to store multiple column mysql query in a list then access each part of query

How would I store a query from mysql into a list.

For example, i have column a b c d,

public list 开发者_开发问答ListA {get; set;}

I want to store column a b c d, and then reference it like

foreach(string here in ListA)
{ string columna = list[0];
string columnab = list[1];}

hope that makes some


A better way to do it would be to create a class like this

class Item
{
    public string A {get; set;}
    public string B {get; set;}
    public string C {get; set;}
    public string D {get; set;}
}

and store and iterate over a List<Item>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜