开发者

Adding new data to DB when using 2 tables

I am new to mvc and mvc 3 , I have a db that contain a company table (string id =as the company name )

And a table tourism that contain same info I would like to be able to add data to the tourism table , while selecting a company from the list (that came from t开发者_开发知识库he company table) (The two tables had a dependency vie company_id (and the same name in both)) How can I do it? Leo_a


  1. create a transaction
  2. insert into the dependent table
  3. inserrt into the main table
  4. commit


I'm not sure I understand the question. You want to select from one table and update the other with the data you selected from the first? Do you have any sample code you can post?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜