Can anyone tell me why my page is throwing this error?
I have a FormView control bound to a OBJECTDATASOURCE control that I've added UPDATE functionality to.
Problem is, everytime I attempt to UPDATE using EditItemTemplate -- save button, I get this error:
ObjectDataSource 'odsProjectBrief' could not find a non-generic method 'UpdateProjectBrief' that has parameters:
Type,
PCSBClassification,
PMUClassification,
Category,
NoOfField,
Complexity,
ProjectObjectives,
Activities,
MechanicalCompletionDate,
InitialAcceptanceDate,
FRDA,
SLIDE4_IMAGE,
Gate3SanctionDate,
FIDSanctionDate,
FDPApproveDate, ProjectBriefId, Name.
HTML code
<asp:FormView ID="fvProjectBrief" runat="server" DataSourceID="odsProjectBrief" DataKeyNames="ProjectBriefId" Width="100%" DefaultMode="Insert" Visible="true" OnPreRender="fvProjectBrief_PreRender"
OnItemInserted="fvProjectBrief_ItemInserted" OnItemUpdated="fvProjectBrief_ItemUpdated">
<InsertItemTemplate></InsertItemTemplate>
<ItemTemplate></ItemTemplate>
<EditItemTemplate>
//other data entry code having textbox and image
<asp:Button ID="Button1" runat="server" ToolTip="Save" CommandName="Update" ButtonType="Update" ValidationGroup="UpdateProjectBrief"></asp:Button>
</EditItemTemplate>
</asp:FormView>
<asp:ObjectDataSource ID="odsProjectBrief" runat="server" SelectMethod="GetProjectBrief" InsertMethod="CreateProjectBrief" UpdateMethod="UpdateProjectBrief" TypeName="SLB.App.Project.ODS.ProjectBrief" OnSelecting="odsProjectBrief_Selecting" OnInserting="odsProjectBrief_Inserting">
<SelectParameters>
<asp:QueryStringParameter QueryStringField="pid" Type="String" Name="ProjectId" />
<asp:QueryStringParameter QueryStringField="pid" Type="String" Name="ProjectBriefId" />
</SelectParameters>
<InsertParameters>
<asp:QueryStringParameter QueryStringField="pid" Type="String" Name="ProjectId" />
<asp:Parameter Name="Name" DbType="String" />
<asp:Parameter Name="ScenarioId" DbType="Guid" />
<asp:Parameter Name="ScenarioCapexOpexId" DbType="Guid" />
<asp:Parameter Name="SchScenarioId" DbType="Guid" />
<asp:Parameter Name="VolumeOilId" DbType="Guid" />
<asp:Parameter Name="VolumeGasId" DbType="Guid" />
<asp:Parameter Name="VolumeCondensateId" DbType="Guid" />
<asp:Parameter Name="Type" DbType="String" />
<asp:Parameter Name="PCSBClassification" DbType="String" />
<asp:Parameter Name="PMUClassification" DbType="String" />
<asp:Parameter Name="Category" DbType="String" />
<asp:Parameter Name="NoOfField" DbType="String" />
<asp:Parameter Name="Field" DbType="String" />
<asp:Parameter Name="Complexity" DbType="String" />
<asp:Parameter Name="PCSBEquity" DbType="String" />
<asp:Parameter Name="ProjectObjectives" DbType="String" />
<asp:Parameter Name="Activities" DbType="String" />
<asp:Parameter Name="MechanicalCompletionDate" Type="DateTime" />
<asp:Parameter Name="InitialAcceptanceDate" Type="DateTime" />
<asp:Parameter Name="FRDA" DbType="String" />
<asp:Parameter Name="DevCapex" DbType="String" />
<asp:Parameter Name="Reserved" DbType="String" />
<asp:Parameter Name="Udc" DbType="String" />
<asp:Parameter Name="HydrocationDate" DbType="String" />
<asp:Parameter Name="txtI15L" DbType="String" />
<asp:Parameter Name="txtI16" DbType="String" />
<asp:parameter Name="SLIDE4_IMAGE" DbType="Byte" />
<asp:parameter Name="Gate3SanctionDate" DbType="DateTime" />
<asp:parameter Name="FIDSanctionDate" DbType="DateTime" />
<asp:parameter Name="FDPApproveDate" DbType="DateTime" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="ProjectBriefId" DbType="Guid" />
<asp:Parameter Name="Type" DbType="String" />
<asp:Parameter Name="PCSBClassification" DbType="String" />
<asp:Parameter Name="PMUClassification" DbType="String" />
<asp:Parameter Name="Category" DbType="String" />
<asp:Parameter Name="NoOfField" DbType="String" />
<asp:Parameter Name="Complexity" DbType="String" />
<asp:Parameter Name="ProjectObjectives" DbType="String" />
<asp:Parameter Name="Activities" DbType="String" />
<asp:Parameter Name="MechanicalCompletionDate" Type="DateTime" />
<asp:Parameter Name="InitialAcceptanceDate" Type="DateTime" />
<asp:Parameter Name="FRDA" DbType="String" />
<asp:parameter Name="SLIDE4_IMAGE" DbType="Byte" />
<asp:parameter Name="Gate3SanctionDate" DbType="DateTime" />
<asp:parameter Name="FIDSanctionDate" DbType="DateTime" />
<asp:parameter Name="FDPApproveDate" DbType="DateTime" />
</UpdateParameters>
</asp:ObjectDataSource>
C# Code
[DataObjectMethod(DataObjectMethodType.Update)]
public void UpdateProjectBrief(
Guid ProjectBriefID, string Name, string Type, string PCSBClassification, string PMUClassification, string Category, string NoOfField,
string Complexity, string ProjectObjectives, string Activities, DateTime? MechanicalCompletionDate, DateTime? InitialAcceptanceDate, string FRDA, byte[] pbSlide4ImageE,
DateTime? Gate3SanctionDate, DateTime? FIDSanctionDate, DateTime? FDPApproveDate
)
{
using (var scope = new System.Transactions.TransactionScope())
{
using (var con = new Modules.ProjectBrief())
{
con.UpdateProjectBrief(ProjectBriefID, Name, Type, PCSBClassification, PMUClassification, Category, NoOfField, Complexity, ProjectObjectives, Activities, MechanicalCompletionDate, InitialAcceptanceDate, FRDA, Gate3SanctionDate, FIDSanctionDate, FDPApproveDate);
con.UpdateProjectBriefImage(ProjectBriefID, pbSlide4ImageE);
}
// commit changes
scope.Complete();
}
}
internal void UpdateProjectBrief(
Guid ProjectBrieID, string Name, string Type, string PCSBClassification, string PMUClassification, string Category, string NoOfField,
string Complexity, string ProjectObjectives, string Activities, DateTime? MechanicalCompletionDate, DateTime? InitialAcceptanceDate, string FRDA,
DateTime? Gate3SanctionDate, DateTime? FIDSanctionDate, DateTime? FDPApproveDate
)
{
var query = (from p in base.Context.P_PROJECT_PROJ_BRIEF_HDR
where p.PROJECT_BRIEF_ID == ProjectBrieID
select p).First();
query.NAME = Name;
query.TYPE = Type;
query.PCSB_CLASSIFICATION = PCSBClassification;
query.PMU_CLASSIFICATION = PMUClassification;
query.CATEGORY = Category;
query.NO_OF_FIELDS = NoOfField;
query.COMPLEXITY = Complexity;
query.PROJECT_OBJECTIVES = ProjectObjectives;
query.ACTIVITIES = Activities;
query.MECHANICAL_COMPLETION = MechanicalCompletionDate;
query.INITIAL_ACCEPTANCE = InitialAcceptanceDate;
query.FRD_ASSUMPTIONS = FRDA;
query.GATE3_SANCTIONDATE = Gate3SanctionDate;
query.FID_SANCTIONDATE = FIDSanctionDate;
query.FDP_APPROVEDDATE = FDPApproveDate;
base.BindUpdateData("");
base.Context.SaveChanges();
}
Please someone help
Thank you in advance