About getting a value from a datarow column, you use the
Item
property. See
DataRow.Item Property (String)[
^]
What comes to the second question, the answer from JoCodes is correct, you can use the
DBNull.Value
, but what puzzles me is that the name of your stored procedure is
GetLatestQuantityOfProduct
. Now if the stored procedure would return rows with
NULL
in
ProductID
, wouldn't that mean that you return amounts but you don't know the product :confused:
What I'm after is that should you instead modify the SQL inside the stored procedure to possibly eliminate this kinds of rows or something else.
Of course I may be on a wrong track since you haven't described the logic and I'm just guessing based on the names :)