public Relation(int Id) { using (IRecordsReader dr = SqlHelper.ExecuteReader("select * from umbracoRelation where id = @id", SqlHelper.CreateParameter("@id", Id))) { if (dr.Read()) { this._id = dr.GetInt("id"); this._parentNode = new CMSNode(dr.GetInt("parentId")); this._childNode = new CMSNode(dr.GetInt("childId")); this._relType = RelationType.GetById(dr.GetInt("relType")); this._comment = dr.GetString("comment"); this._datetime = dr.GetDateTime("datetime"); } else { throw new ArgumentException("No relation found for id " + Id.ToString()); } } }