public static LocationInfo GetLocationById(int locationId) { int retValue = -1; LocationInfo location = new LocationInfo(); //Generated Code for query : dbo.GetAllVendors using (SqlDataReader dr = ProjManagementAdmin.GetLocationById(locationId, out retValue)) //Initialize and retrieve code for Datareader goes here { while (dr.Read()) { location.LocationId = Convert.ToInt32(dr["location_id"]); location.LocationName = dr["location_name"].ToString(); location.IsActive = Convert.ToBoolean(dr["is_active"]); location.CreatedDate = Convert.ToDateTime(dr["created_date"]); location.ChangedDate = Convert.ToDateTime(dr["changed_date"]); location.ChangedByName = dr["changed_by"].ToString(); } //dr.Close(); } return(location); }