开发者

SQL INSERT with Inner Join

I Have a Table (Accommodation) with All information about a holiday home. Inc ID Name etc. I have another Table (Schedule) with a Schedule ID, Date and Price I have a final table to join the two (SchdAccom) with A schdaccom id, the AccomodationID and Schdule ID.

What this allows is me to add dates a holiday home is available for use by linking its id with an id of a date and 1 home can link with many dates/price.

Heres my issue I can query this fine no problem works开发者_运维百科 great but im unsure how to go about inserting new ones. For instance, at the moment you as an admin select the holiday home click a button to see the dates and a gridview pulls this info. I want to be able to add more dates but the tableadapter wont generate insert code.

Any idea on how to go about this?


The best method would be to generate SQL that would inject data into both tables when you submit the request. Because you're working with 2 different tables, you're going to have to write a bit of manual code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜