c# - Linq Result Join all Rows Data to string -
i getting data 200k
records database
, store in linq
result columnname
email
. now,i want show emails linq
result
, adding them textbox
separating ,
.
actually,i have prepared datatable
linq
result , have combined row data code :
var datalists = (from xx in vdc.survey_email_list xx.email_group_id == listgroupid select xx).tolist(); datatable dtdatalists = linqtodatatable(datalists); emailids = string.join(",", dtdatalists.asenumerable().select(x => x["emailid"].tostring()).toarray());
but,for preparing datatable
,it taking long time. so,i thought of preparing string
emailids
directly linq
result. can me?
this code should work i'm not sure it'll faster:
string.join(",", datalists.select(x => x.emailid));
Comments
Post a Comment