public static CustomList <OTSlab> GetAllOTSlab(string otSlabID) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <OTSlab> OTSlabCollection = new CustomList <OTSlab>(); IDataReader reader = null; String sql = "select *from OTSlab where OTSlabID = " + otSlabID; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { OTSlab newOTSlab = new OTSlab(); newOTSlab.SetData(reader); OTSlabCollection.Add(newOTSlab); } return(OTSlabCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }