MonkeyWrench.DB.GetHostLane C# (CSharp) Méthode

GetHostLane() public méthode

public GetHostLane ( int host_id, int lane_id ) : DBHostLane
host_id int
lane_id int
Résultat MonkeyWrench.DataClasses.DBHostLane
		public DBHostLane GetHostLane (int host_id, int lane_id)
		{
			DBHostLane result;
			using (IDbCommand cmd = CreateCommand ()) {
				cmd.CommandText = "SELECT * FROM HostLane WHERE lane_id = @lane_id AND host_id = @host_id;";
				DB.CreateParameter (cmd, "host_id", host_id);
				DB.CreateParameter (cmd, "lane_id", lane_id);
				using (IDataReader reader = cmd.ExecuteReader ()) {
					if (!reader.Read ())
						return null;
					result = new DBHostLane (reader);
					if (reader.Read ())
						throw new Exception (string.Format ("Found more than one HostLane with host_id {0} and lane_id {1}", host_id, lane_id));
				}
			}
			return result;
		}