How assign value 0 in else part?

Posted by Karthik2010_Mca under C# on 8/7/2013 | Points: 10 | Views : 701 | Status : [Member] | Replies : 2
Hi,

In the below example I need to add value 0 in the else part.

Ex:
if (this.InvoiceChild[i].InvoiceChildDetails[j].AmountDue != 0)
{
xInstallment.SetAttribute("I_Display_Fee_Component_ID", this.InvoiceChild[i].InvoiceChildDetails[j].DisplayFeeComponentId.ToString());
}
else
{
xInstallment.SetAttribute("I_Display_Fee_Component_ID", (this.InvoiceChild[i].InvoiceChildDetails[j].DisplayFeeComponentId).ToString()); // Here I want to add value 0.
}

Thanks

Karthik


Responses

Posted by: Jeyanthi on: 8/7/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Can try any of the following in else part

else
{
xInstallment.SetAttribute("I_Display_Fee_Component_ID", "0");
}
or
else
{
xInstallment.SetAttribute("I_Display_Fee_Component_ID", Convert.ToString("0"));
}

Regards,
Jeyanthi

Karthik2010_Mca, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthik2010_Mca on: 8/7/2013 [Member] Starter | Points: 25

Up
0
Down

Hi Jeyanthi,

Your mentioned 2nd one is working fine. Thanks a lot.

Thanks
Karthik.K

Karthik

Karthik2010_Mca, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response