2
Answers

How to handle null value during convert a column into a string array

Photo of Michael Xie

Michael Xie

14y
4.2k
1
I have a problem when i try to convert a column to a string array.

here is my code:


string[] s = Array.ConvertAll<DataRow, string>(datatable.Select(), delegate(DataRow row) {return(string)row["columnname"];});

error is: in the datacolumn, there is null , empty and 'none' value.

i want to my s contains only the entity not including null, empty, 'none' value.

Any help will be appreciate! 

 

Answers (2)