2
Reply

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

Michael Xie

Michael Xie

Feb 18 2011 3:00 PM
3.3k
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)