Hello
When I press in a button "Update", I find this error:
"objectdatasource could not find a non-generic method 'update' that has parameters:
ID_MODULE, NAME_COMPONENT, DESCRIPTION_COMPONENT, TYPE_COMPONENT, CODE_COMPONENT, ID_COMPONENT, NAME_COMPONENT_1, TYPE_COMPONENT_1, DESCRIPTION_COMPONENT_2."
and the code of my gridview in this page is:
<fieldset>
<legend>Module
<asp:Label ID="moduleNameLabel" runat="server"></asp:Label>
components list</legend>
<br />
<div class="scroller_rem_boq">
<asp:GridView ID="GridviewComponent" runat="server" DataKeyNames="ID_COMPONENT"
AllowSorting="True" AutoGenerateColumns="False" PageSize="5" DataSourceID="ObjectDataSourceComponent"
OnRowDataBound="GridviewComponent_RowDataBound" OnRowDeleting="GridviewComponent_RowDeleting"
CellPadding="4" ForeColor="#333333" Width="90%" OnRowCommand="GridviewComponent_RowCommand">
<Columns>
<asp:BoundField DataField="ID_COMPONENT" HeaderText="COMPONENT ID">
<ItemStyle CssClass="ColonneId" />
<HeaderStyle CssClass="ColonneId" />
</asp:BoundField>
<asp:BoundField DataField="ID_MODULE" HeaderText="MODULE CODE">
<ItemStyle CssClass="ColonneId" />
<HeaderStyle CssClass="ColonneId" />
</asp:BoundField>
<asp:TemplateField HeaderText="COMPONENT CODE" SortExpression="CODE_COMPONENT">
<EditItemTemplate>
<asp:TextBox ID="TextBoxdCode" runat="server" Text='<%# Bind("CODE_COMPONENT") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="LabeliD" runat="server" Text='<%# Bind("ID_COMPONENT") %>' Visible="false"></asp:Label>
<asp:Label ID="LabelCode" runat="server" Text='<%# Bind("CODE_COMPONENT") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="COMPONENT NAME" SortExpression="NAME_COMPONENT_1">
<EditItemTemplate>
<asp:Panel runat="server" HorizontalAlign="left">
<asp:TextBox ID="TextBoxName" Width="200" runat="server" Text='<%# Bind("NAME_COMPONENT_1") %>'></asp:TextBox>
</asp:Panel>
</EditItemTemplate>
<ItemTemplate>
<asp:Panel runat="server" HorizontalAlign="left">
<asp:Label ID="LabelName" Width="200" runat="server" Text='<%# Bind("NAME_COMPONENT_1") %>'></asp:Label>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="COMPONENT TYPE" SortExpression="TYPE_COMPONENT_1">
<EditItemTemplate>
<asp:DropDownList ID="DdlTypeComp" runat="server" Width="215px" Text='<%# Bind("TYPE_COMPONENT_1")%>'>
<asp:ListItem>Base</asp:ListItem>
<asp:ListItem>Satelite</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="LabelType" runat="server" Text='<%# Bind("TYPE_COMPONENT_1") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="COMPONENT DESCRIPTION" SortExpression="DESCRIPTION_COMPONENT_2">
<EditItemTemplate>
<asp:TextBox ID="TextBoxDescr" TextMode="MultiLine" Width="450px" Height="40px" Font-Size="Small"
runat="server" Text='<%# Bind("DESCRIPTION_COMPONENT_2") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:TextBox ID="TextBoxDescr1" TextMode="MultiLine" ReadOnly="true" Width="450px"
Height="40px" Font-Size="Small" runat="server" Text='<%# Bind("DESCRIPTION_COMPONENT_2") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:ImageButton ID="ImageBtnEditDetail" runat="server" CausesValidation="True" CommandName="Update"
ImageUrl="~/images/icons/tick.png" AlternateText="Update" />
<asp:ImageButton ID="ImageBtnCancel" runat="server" CausesValidation="False" CommandName="Cancel"
ImageUrl="~/images/icons/arrow_right.png" AlternateText="cancel" />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageBtnEditDetail" runat="server" CausesValidation="False"
CommandName="Edit" ImageUrl="~/images/icons/pencil.png" AlternateText="Edit" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:ImageButton ID="ImgDelete" runat="server" CausesValidation="False" CommandName="delete"
ImageUrl="~/images/icons/cross.png" AlternateText="Delete" />
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField CommandName="Copy" ButtonType="Image" ImageUrl="~/images/icons/page_copy.png" />
</Columns>
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</div>
</fieldset>
<asp:ObjectDataSource ID="ObjectDataSourceComponent" runat="server" DeleteMethod="delete"
SelectMethod="Get" TypeName="cwt_package.Component" UpdateMethod="Update" >
<DeleteParameters>
<asp:Parameter Name="ID_MODULE" Type="String" />
<asp:Parameter Name="ID_COMPONENT" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ID_MODULE" Type="String" />
<asp:Parameter Name="NAME_COMPONENT" Type="String" />
<asp:Parameter Name="DESCRIPTION_COMPONENT" Type="String" />
<asp:Parameter Name="TYPE_COMPONENT" Type="String" />
<asp:Parameter Name="CODE_COMPONENT" Type="String" />
<asp:Parameter Name="ID_COMPONENT" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter ControlID="DdlModul" Name="ID_MODULE" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</asp:Panel>
</div>
the update methode in "cwt_package.Component" is
public void Update(string ID_MODULE,string NAME_COMPONENT,string DESCRIPTION_COMPONENT,string TYPE_COMPONENT,string CODE_COMPONENT,string ID_COMPONENT)
{
try
{
DataTable moduleComponenents;
moduleComponenents = this.existsComponentInModule(ID_COMPONENT, CODE_COMPONENT, ID_MODULE);
if (moduleComponenents.Rows.Count == 0)
{
OracleConnection chaine = cwt_package.connexion.connectString();
OracleCommand command = new OracleCommand("pa_component.modifier", chaine);
command.CommandType = CommandType.StoredProcedure;
OracleParameter IdComp = new OracleParameter("IdComp", OracleDbType.Varchar2);
IdComp.Direction = ParameterDirection.Input;
IdComp.Value = ID_COMPONENT;
command.Parameters.Add(IdComp);
OracleParameter codeComp = new OracleParameter("codeComp", OracleDbType.Varchar2);
codeComp.Direction = ParameterDirection.Input;
codeComp.Value = CODE_COMPONENT;
command.Parameters.Add(codeComp);
OracleParameter idMod = new OracleParameter("idMod", OracleDbType.Varchar2);
idMod.Direction = ParameterDirection.Input;
idMod.Value = ID_MODULE;
command.Parameters.Add(idMod);
OracleParameter nameComp = new OracleParameter("nameComp", OracleDbType.Varchar2);
nameComp.Direction = ParameterDirection.Input;
nameComp.Value = NAME_COMPONENT;
command.Parameters.Add(nameComp);
OracleParameter descr = new OracleParameter("descr", OracleDbType.Varchar2);
descr.Direction = ParameterDirection.Input;
descr.Value = DESCRIPTION_COMPONENT;
command.Parameters.Add(descr);
OracleParameter typ = new OracleParameter("typ", OracleDbType.Varchar2);
typ.Direction = ParameterDirection.Input;
typ.Value = TYPE_COMPONENT;
command.Parameters.Add(typ);
chaine.Open();
command.ExecuteNonQuery();
chaine.Close();
}
else
{
MessageBox.Show("You can't edit the code of the " + TYPE_COMPONENT + " " + CODE_COMPONENT + " , it already exists in this module !!");
}
}
catch (OracleException ex)
{
}
}
the package "pa_component.modifier" is:
"
PROCEDURE modifier(
idComp COMPONENT.ID_COMPONENT%TYPE,
codeComp COMPONENT.CODE_COMPONENT%TYPE,
idMod COMPONENT.ID_MODULE%TYPE,
nameComp COMPONENT.NAME_COMPONENT_1%TYPE,
descr COMPONENT.DESCRIPTION_COMPONENT_2%TYPE,
typ COMPONENT.TYPE_COMPONENT_1%TYPE
) IS
CURSOR cur_inputOutput(
p_idModule COMPONENT.ID_MODULE%TYPE,
p_idComponent COMPONENT.ID_COMPONENT%Type)
IS
SELECT *
FROM INPUTOUTPUTS
WHERE ID_MODULE = p_idModule
AND ID_COMPONENT = p_idComponent;
row_inputOutput INPUTOUTPUTS%ROWTYPE;
row_component COMPONENT%ROWTYPE;
/*** BEGIN : DECLARATION DES VARIABLES POUR LA REGENERATION DES ADRESSES***/
v_formula INPUTOUTPUTS.FORMULA1%Type;
v_inoutput_adress INPUTOUTPUTS.INOUTPUTSADRESS%type;
v_item_adress INPUTOUTPUTS.ITEMADRESS%Type;
/*** END : DECLARATION DES VARIABLES POUR LA REGENERATION DES ADRESSES***/
BEGIN
/* codeComp ====> New */
/* idComp ====> Old */
if codeComp != idComp then
for row_inputOutput in cur_inputOutput(idMod ,idComp)
loop
IF row_inputOutput.INOUTPUTSTYPES = 'Input' then
/*** DANS LE CAS D'UN INPUT ***/
v_formula := '[Module_'||idMod||'_Input].['||codeComp||'_'||row_inputOutput.CODEINOUTPUTS||']';
v_inoutput_adress := '[Module_'||idMod||'_Input].['||codeComp||'_'||row_inputOutput.CODEINOUTPUTS||']';
if length(row_inputOutput.CODE_ITEM_STANDARD) > 0 then
v_item_adress := '[Module_'||idMod||'_Input_Item].['||codeComp||'_'||row_inputOutput.CODEINOUTPUTS||']';
else
v_item_adress := '';
end if;
/*** DANS LE CAS D'UN INPUT ***/
else
/*** DANS LE CAS D'UN OUTPUT ***/
v_inoutput_adress := '[Module_'||idMod||'_Output].['||codeComp||'_'||row_inputOutput.CODEINOUTPUTS||']';
if length(row_inputOutput.CODE_ITEM_STANDARD) > 0 then
v_item_adress := '[Module_'||idMod||'_Output_Item].['||codeComp||'_'||row_inputOutput.CODEINOUTPUTS||']';
else
v_item_adress := '';
end if;
v_formula := row_inputOutput.FORMULA1;
/*** DANS LE CAS D'UN OUTPUT ***/
end if;
Update INPUTOUTPUTS
SET ITEMADRESS = v_item_adress
,INOUTPUTSADRESS = v_inoutput_adress
,FORMULA1 = v_formula
Where ID_MODULE = idMod
and ID_COMPONENT = idComp
and CODEINOUTPUTS = row_inputOutput.CODEINOUTPUTS;
commit;
end loop;
UPDATE COMPONENT
SET
NAME_COMPONENT_1 = nameComp
,DESCRIPTION_COMPONENT_2 = descr
,TYPE_COMPONENT_1 = typ
,CODE_COMPONENT = codeComp
WHERE ID_COMPONENT = idComp
and ID_MODULE = idMod;
else
UPDATE COMPONENT
SET
NAME_COMPONENT_1 = nameComp
,DESCRIPTION_COMPONENT_2 = descr
,TYPE_COMPONENT_1 = typ
,CODE_COMPONENT = codeComp
WHERE ID_COMPONENT = idComp
and ID_MODULE = idMod;
end if;
END modifier;
the table Component contains this columns :
"ID_COMPONENT,ID_MODULE,NAME_COMPONENT_1,DESCRIPTION_COMPONENT_2
,TYPE_COMPONENT_1,CODE_COMPONENT"
please where is the error ????