Posted on: 9/13/2013 3:03:36 PM | Views : 580

I have three tables:
table1: tid(PK), date, DeptID(FK), BranchID(FK), doc
table2: DeptID(PK), DeptNo
table3: BranchID(PK), BranchCode
I have FormView which display the fields: tid, date, doc, DeptNo, BranchCode.
I want to insert new records for table1: date, doc. ( I think I can not insert DeptID, BranchID directly for this table1 as they are FKs)
But I think I can update these fields (DeptID and BranchID).
In the FormView, I use two dropdownlists to select value for DeptID and BranchCode
How to write SelectCommand, InsertCommand and UpdateCommand in <asp:SqlDataSource> or how to implement this?

Thanks.
...

Go to the complete details ...