How to add excel column row data to Array of string variable?

I am having columns name "Approved " and "Denials ". i need get row data into arraylist… c#, and avoid blanks

I had read excel sheet and stored in DT. i had kept for each and able to read all data indivudally.

1 Like

Hi!

Share us the input and expected output!

Regards,

Hi @MitheshBolla ,

The Below Expression should provide you the Output as Array of String, which would have values present in the Column “Approvals”.

DT.AsEnumerable().Where(a=>!String.IsNullOrWhiteSpace(a["Approvals"].ToString())).ToArray()
1 Like

If i assign to variable of data type arry of string its showing error.

@MitheshBolla ,

Apologies, Do find the Updated Expression below :

DT.AsEnumerable().Where(a=>!String.IsNullOrWhiteSpace(a["Approvals"].ToString())).Select(a=>a["Approvals"].ToString()).ToArray()
1 Like

What is here a>=! String

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