Constant value.
Posted
by Harikrishna
on Stack Overflow
See other posts from Stack Overflow
or by Harikrishna
Published on 2010-05-14T12:21:41Z
Indexed on
2010/05/14
12:24 UTC
Read the original article
Hit count: 289
Is there any constant value like if we display it in the datagridview it will not display and if we add it in the decimal value the value remains as it is ?
Like what I am doing is, I am making addition of two columns say B,C
for the column A
like
dataTable.Columns["A"].Expression="B+C";
Now problem is when there is any value of column B
or C
is null
then there is no value in the column A
because of A=B+C
like 1+null
is null
.
And even I can not replace 0
where there is null
for the column B
or C
because I am displaying records of each column A,B and C
in the datagridview and I don't want to display value for column which has value null
so if I replace 0
where there is null
then 0
will be displayed for that column which I don't want. So what should I do for that ?
So what is the constant value which I should replace for null
value for the column B and C
so if value of A
remains it is and even that value will not be displayed in the datagridview.
© Stack Overflow or respective owner