Praw1n
(PRAVEEN KUMAR MANDADI)
1
Hello,
I have a DataTable(Dt1) with 6 Columns. I want to convert “Quantity” Column into an array…
So I have tried Dt1.AsEnumerable.Select(Function(a) a.Field(Of String)(“Quant Status”).ToString).ToArray() and it worked.
But, Some columns have an empty rows… as below
So I’m getting an Null Exception Error. How can I overcome this issue ? Please Help me.
Yoichi
(Yoichi)
2
Hi
Can you try the following expression?
arrStr = dt.AsEnumerable.Select(Function(r) if(r("Quantity") isnot Nothing, r("Quantity").ToString(),"")).ToArray()
Regards,
3 Likes
system
(system)
Closed
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.