Michael Xie

Michael Xie

  • NA
  • 41
  • 8k

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

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