how to Replace null value with 0 Using C#

08:45 Sumit Shekhawat 1 Comments

how to Replace null value with 0 Using C#



//here we suppose that objDataTable have data collection as table now access this //datatable object.

decimal j = 0;

 j = objDataTable.Rows[0]["Qty"] == DBNull.Value ? 0 : Convert.ToDecimal(objDataTable.Rows[0]["Qty"]);




NOTE :-
//if  DBNull.value is null then  "0 " else  "your code here") 
// ? = then
// : = else




Thank You
[Sumit Singh Shekhawat]

1 comment:

  1. How To Replace Null Value With 0 Using C >>>>> Download Now

    >>>>> Download Full

    How To Replace Null Value With 0 Using C >>>>> Download LINK

    >>>>> Download Now

    How To Replace Null Value With 0 Using C >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete