Thursday, August 18, 2022

How to pass dbnull or zero values to Textbox ASP.NET C#

 Txt_Reimburse.Text = dt.Rows[0]["NSQF_Reimburse_Duration_in_Hour"] == DBNull.Value ? "0" : Convert.ToString(dt.Rows[0]["NSQF_Reimburse_duration_in_hour"]);

                TXT_OJTNOS.Text = Txt_Reimburse.Text == "0" ? "0" : (Convert.ToString(int.Parse(Txt_Reimburse.Text) - int.Parse(Txt_CHASN.Text)));

No comments:

Post a Comment