Dreamweaver sometimes puts Server Behaviors in the wrong order, so you have to pay attention to the order of operations. In your case you want to upload a file, insert into the main table, then insert into the associated table. If the server behaviors appear in the wrong order, then you have to cut and paste them into the correct order in the code.