I have a page with two formviews on it - fvPeople and fvAddress. Each is linked to its own objectdatasource (with DataObjectTypeName set to a class taht defiens all the fields). The fvPeople is the "owner" of the address.
The ODS for fvAddress contains a field called People_Link which is the Id of the People record. This field is not displayed within the formview. Updating an existing address record for a People record works fine, but when it comes to inserting an Address record then I run into trouble -- I can't pass the People record's Id to the Insert procedure of the ods -- if I define the method as "InsertAddress(AddressODS_
DO addr, int InsertCoupleId) -- it complains about being unable to find a generic method that takes just "AddressODS_DO" as paremeter.
As an experiment, I placed the "People_Link" field in the InsertTemplate, making it invisible. This seems to work -- just not sure how acecptable this is?
Any thoughts on how to get around this?
In advance, thanks!!!
<asp:ObjectDataSource ID="addressODS" runat="Server" SelectMethod="GetResidential" TypeName="BusinessLogic.Business"
DataObjectTypeName="DataTransferObjects.AddressODS_DO" InsertMethod="AddressODS_Insert" OnInserting="AddressODS_Inserting"
UpdateMethod="AddressODS_Update" OnUpdated="AddressODS_Updated" OnSelecting="addressODS_Selecting" >
<asp:QueryStringParameter Name="CoupleId" DbType="Int32" Direction="Input" DefaultValue="0" />
<asp:QueryStringParameter Name="InsertCoupleId" DbType="Int32" Direction="Input" DefaultValue="0" />
public static bool AddressODS_Insert(AddressODS_DO address, int AddressODS_DO)
insertStatus = DataAccess.ApplyInsertAddress(address);