Last post Oct 17, 2018 03:07 AM by homertechnologies
Member
504 Points
1776 Posts
Oct 15, 2018 07:17 AM|JagjitSingh|LINK
Hi
On below line i am getting above error
if(dt.Rows[i]["Sh1"] != DBNull.Value ? Convert.ToDecimal(dt.Rows[i]["Sh1"]) : 0 > 0);
Thanks
All-Star
18815 Points
3831 Posts
Oct 15, 2018 07:34 AM|Nan Yu|LINK
Hi JagjitSingh ,
Convert.ToDecimal(dt.Rows[i]["Sh1"]) is Decimal type , 0 > 0 is Bool type(False ) . Base on your requirement , you can modify your code . For example :
if (dt.Rows[i]["Sh1"] != DBNull.Value ? true : false) { }
Best Regards,
Nan yU
631 Points
361 Posts
Oct 17, 2018 03:07 AM|homertechnologies|LINK
you statement is wrong
you are using a short form of If in If Condition
more over 0>0 is invalid
what are you trying to do?
Member
504 Points
1776 Posts
Error - Type of conditional expression cannot be determined because there is no implicit conversi...
Oct 15, 2018 07:17 AM|JagjitSingh|LINK
Hi
On below line i am getting above error
if(dt.Rows[i]["Sh1"] != DBNull.Value ? Convert.ToDecimal(dt.Rows[i]["Sh1"]) : 0 > 0);
Thanks
All-Star
18815 Points
3831 Posts
Re: Error - Type of conditional expression cannot be determined because there is no implicit conv...
Oct 15, 2018 07:34 AM|Nan Yu|LINK
Hi JagjitSingh ,
Convert.ToDecimal(dt.Rows[i]["Sh1"]) is Decimal type , 0 > 0 is Bool type(False ) . Base on your requirement , you can modify your code . For example :
Best Regards,
Nan yU
Member
631 Points
361 Posts
Re: Error - Type of conditional expression cannot be determined because there is no implicit conv...
Oct 17, 2018 03:07 AM|homertechnologies|LINK
you statement is wrong
you are using a short form of If in If Condition
more over 0>0 is invalid
what are you trying to do?