public static CustomList <OTSlab> GetAllOTSlab() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <OTSlab> OTSlabCollection = new CustomList <OTSlab>(); IDataReader reader = null; const String sql = "select Distinct OTSlabID from OTSlab"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { OTSlab newOTSlab = new OTSlab(); newOTSlab.SetDataOTSlab(reader); OTSlabCollection.Add(newOTSlab); } OTSlabCollection.InsertSpName = "spInsertOTSlab"; OTSlabCollection.UpdateSpName = "spUpdateOTSlab"; OTSlabCollection.DeleteSpName = "spDeleteOTSlab"; return(OTSlabCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }