Id | Product Name |Color | Material
------------------------------------ // products
1 car 1 | 2
2 desk 3 | 1
3 window 2 | 3
-----------------------
Id | Product Color Name
----------------------- // productColor
1 red
2 blue
3 yellow
-----------------------
Id | Product Material Name
----------------------- // productMaterial
1 Metal
2 Glass
3 Wood
-----------------------
I have a dropdownlist that reads from table Products and populate textboxes with specified property of material.
I use foreignKey to connect products table with data from Material and colors.
How can I populate the database with new products. ( the new products have and new materials)
New Product that will be listed in ddlist will be named phone and populates txtboxes using color(purple) and material (plastic)
If you’re picking from a predefined list of careers in your career table, the select for the career should have a visible string of the CareerName and a value of IDCareer. When the user selects one, you have the id value that goes into your insert SQL. Suppose your table is populated with an id of 3 for career Fire fighter. When the user picks Fire fighter, your SQL would put 3 in the ‘and here I’m lost’ from your post.
If the issue is that you’re collecting new values, you must put them in first, get the id number of the newly inserted career (you’re using an auto_increment (MySQL), sequence (Oracle), or identity (SQL Server) for those IDCareer values, yes?) using whatever function returns the last inserted id value, and put that in your ‘and here I’m lost’.