vb.net - Merge two string fields with LINQ into a string array -
i have 2 fields in dataset [firstname]
, [lastname]
. system.data.enumerablerowcollection
object following query:
dim query = dt in _dataset.datatable1 teamname = "the avangers" select dt.firstname , dt.lastname
i looking way merge firstname , lastname stringarray following entries:
item(0): "banner, bruce" item(1): "stark, tony" item(2): "rogers, steve" ...
what did performed separate query first , lastname use .toarray on both queries. afterwards merged them in each loop. wanted ask if there faster way perform that.
just concatenate firstname
, lastname
in query , apply toarray
@ end.
select dt.lastname + ", " & dt.firstname
Comments
Post a Comment