I am developing winform application using C# and I need to simplfy. So please help me anyone how to Simplfy below my code . I have given below am using code.
try
{
object countnew = ((DataTable)grid_cheque.DataSource).Compute("Count(ChequeStatus)", "ChequeStatus = 'New'");
object countIssued = ((DataTable)grid_cheque.DataSource).Compute("Count(ChequeStatus)", "ChequeStatus = 'Issued'");
object countCancelled = ((DataTable)grid_cheque.DataSource).Compute("Count(ChequeStatus)", "ChequeStatus = 'Cancelled'");
object countDishonour = ((DataTable)grid_cheque.DataSource).Compute("Count(ChequeStatus)", "ChequeStatus = 'DisHonour'");
this.lblNew.Text = ERPModule.isnull(Convert.ToString(countnew), "0");
this.lbl_Issued.Text = ERPModule.isnull(Convert.ToString(countIssued), "0");
this.lblCancel.Text = ERPModule.isnull(Convert.ToString(countCancelled), "0");
this.lbldishonour.Text = ERPModule.isnull(Convert.ToString(countDishonour), "0");
}
catch (Exception ex)
{
}