I need help with an sql statement.
I am managing a real estate database. I have a table Properties and multiple tables Bedrooms, Bathrooms etc.
I have a form in which my agent can see in a listbox all the properties, selects the one he likes and it will display the right informations in all the combobox
Each criteria is shown in a combobox. So if you show Property 1 you see : Bedrooms: 1bedroom
Right now my sql statement is:
"SELECT AreaSize.AreaSizeID, AreaSize.DescriptionSurface, Bathrooms.BathroomID, Bathrooms.DescriptionBathroom, Cities.CityID, Cities.DescriptionCities, Prices.PriceID, Prices.DescriptionPrices, Properties.*, Rooms.RoomID, Rooms.DescriptionRooms, Types.TypeID, Types.DescriptionType, Users.* FROM Users INNER JOIN (Types INNER JOIN (Rooms INNER JOIN (Prices INNER JOIN (Cities INNER JOIN (Bathrooms INNER JOIN (AreaSize INNER JOIN Properties ON AreaSize.AreaSizeID = Properties.AreaSize) ON Bathrooms.BathroomID = Properties.Bathrooms) ON Cities.CityID = Properties.City) ON Prices.PriceID = Properties.Price) ON Rooms.RoomID = Properties.Rooms) ON Types.TypeID = Properties.PropertyType) ON Users.UserID = Properties.AgentID WHERE Users.email =@email";
How I display in a combobox:
cboBedrooms.Text = tbListing.Rows[idx]["DescriptionRooms"].ToString();
The problem is that right now it only shows the value of the property selected and not all the other values.
if i am in property 2, combobox for bedrooms shows only: 2 bedrooms
it should show: 2 bedrooms, than you click on the arrow and shows 1 bedroom
+-----------------------------------------+
| Properties |
+------------+------------+---------------+
| PropertyID | NbBedrooms | AgentID... |
| 1 | 1 | 2... |
| 2 | 2 | 1... |
+------------+------------+------------+
+-------------------------+
| Bedrooms |
+------------+------------+
| PropertyID | NbBedrooms |
| 1 | 1bedroom |
| 2 | 2bedrooms |
+------------+------------+