IEnumerable to string

前端 未结 7 2133
既然无缘
既然无缘 2021-02-04 23:55

I have a DataTable that returns

IDs
,1
,2
,3
,4
,5
,100
,101

I want to convert this to single string value, i.e:

,1,2,3,4,5,100         


        
相关标签:
7条回答
  • Try this:

    var _values = _tbl.AsEnumerable().Select(x => x);
    string valueString = _values.ToList().Aggregate((a, b) => a + b);
    
    0 讨论(0)
提交回复
热议问题