Converter coluna de tabela de dados em matriz

Olá comunidade, estou com um problema na seguinte expressão:
tabela. AsEnumerable().Select(Function (a) a.Field(Of String)(“FORNECEDOR”).toString).toArray()

O que me retorna é apenas: “System.String”, não me retorna a matriz de dados.

Hi @devrpa746 ,

Refer to the following thread by @rohith.prabhu, it explains how to convert the column to an array:

Regards,

1 Like

@devrpa746

Please try this

dt.AsEnumerable.Select(function(x) x("ColumnName").ToString).ToArray

I guess it is returning a string array for you as well to print use like this

String.Join(",",dt.AsEnumerable.Select(function(x) x("ColumnName").ToString))

cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.