private string cntCustName(string custNo) { string _whereClause = BindWhereClause(); _whereClause = (_whereClause == "" ? "" : " and " + _whereClause); DataTable dtCustomer = new DataTable(); string tableName = "CustomerMaster"; string columnName = "Count(*) as totalcount";//Contract No,Form Dist, string whereClause = " CustName Like '" + custNo.Trim().Replace("%", "").Replace("'", "''") + "%'" + _whereClause; DataSet dsCustomer = customerMaintenance.ExecuteERPSelectQuery(tableName, columnName, whereClause); if (dsCustomer != null && dsCustomer.Tables[0].Rows.Count > 0) { dtCustomer = dsCustomer.Tables[0]; return(dtCustomer.Rows[0]["totalcount"].ToString()); } else { return("0"); } }