public InnerRoad getRelatedInnerRoad() { if (!isValid(new List<string>() { "prID", "vName", "vBoundary", "vInUse" })) return null; string sqlCommand = String.Format("select irID from InnerRoad where vID={0}", vID); Sql sql = new Sql(); SqlDataReader reader = sql.selectInnerRoadIDByVillageID(sqlCommand); if (reader.HasRows) { reader.Read(); int innerRoadID = Int32.Parse(reader[0].ToString()); InnerRoad innerRoad = new InnerRoad(); innerRoad.id = innerRoadID; innerRoad.select(); return innerRoad; } else { return null; } }