M
Mike P
I have a formview which has exactly the same parameters as a
detailsview, but I get an error when I try to update when editing the
formview. Here are my update parameters :
<UpdateParameters>
<asparameter Name="ProductTypeID"
Type="Int32" />
<asparameter Name="OpportunityTypeID"
Type="Int32" />
<asparameter Name="MonetaryValue"
Type="Double" />
<asparameter Name="ProbabilityID"
Type="Int32" />
<asparameter Name="Location" Type="String"
/>
<asparameter Name="OpportunityStatusID"
Type="Int32" />
<asparameter Name="Description"
Type="String" />
<asparameter Name="OpportunityID"
Type="Int32" />
</UpdateParameters>
And the EditItemTemplate :
<EditItemTemplate>
<table width="500">
<tr>
<td width="100px" align="right">
<asp:label
id="lblOpportunityID3" Runat="server" SkinID="Main">Opportunity ID
:</asp:label>
</td>
<td width="100px">
<asp:Label
ID="lblOpportunityID4" runat="server" Text='<%# Bind("OpportunityID")
%>'></asp:Label>
</td>
<td width="100px" align="right">
<asp:label id="lblProductType3"
Runat="server" SkinID="Main">Product Type :</asp:label>
</td>
<td width="100px">
<aspropDownList
ID="ddlProductType" runat="server" DataSourceID="SqlDataSource2"
DataTextField="ProductType"
DataValueField="ProductTypeID"
SelectedValue='<%#
Bind("ProductTypeID") %>'></aspropDownList>
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label
id="lblOpportunityType3" Runat="server" SkinID="Main">Opportunity Type
:</asp:label>
</td>
<td width="100px">
<aspropDownList
id="ddlOpportunityType" DataSourceID="SqlDataSource3" Runat="Server"
DataTextField="OpportunityType"
DataValueField="OpportunityTypeID" SelectedValue='<%#
Bind("OpportunityTypeID") %>'/>
</td>
<td width="100px" align="right">
<asp:label id="lblValue3"
Runat="server" SkinID="Main">Value (£) :</asp:label>
</td>
<td width="100px">
<asp:TextBox ID="txtValue"
Text='<%# Bind("MonetaryValue") %>' runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtValue"
Display="None" ErrorMessage="Please enter a Value" />
<asp:RangeValidator
ID="RangeValidator1" runat="server"
ControlToValidate="txtValue"
Type="Double" MaximumValue="4000000"
MinimumValue="0" Display="None"
ErrorMessage="Value must be numeric" />
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label id="lblProbability3"
Runat="server" SkinID="Main">Probability (%) :</asp:label>
</td>
<td width="100px">
<aspropDownList
id="ddlProbability" DataSourceID="SqlDataSource4" Runat="Server"
DataTextField="Probability"
DataValueField="ProbabilityID" SelectedValue='<%# Bind("ProbabilityID")
%>'/>
</td>
<td width="100px" align="right">
<asp:label id="lblLocation3"
Runat="server" SkinID="Main">Location :</asp:label>
</td>
<td width="100px">
<asp:TextBox ID="txtLocation"
Text='<%# Bind("Location") %>' runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ControlToValidate="txtLocation"
Display="None" ErrorMessage="Please enter a Location" />
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label id="lblCompanyName3"
Runat="server" SkinID="Main">Company Name :</asp:label>
</td>
<td width="100px">
<asp:Label ID="lblCompanyName"
runat="server" Text='<%# Bind("CompanyName") %>'></asp:Label>
</td>
<td width="100px" align="right">
<asp:label id="lblDateCreated3"
Runat="server" SkinID="Main">Date Created :</asp:label>
</td>
<td width="100px">
<asp:Label ID="lblDateCreated"
runat="server" Text='<%# Bind("DateCreated") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label id="lblStatus3"
Runat="server" SkinID="Main">Status :</asp:label>
</td>
<td width="100px">
<aspropDownList
id="ddlOpportunityStatus" DataSourceID="SqlDataSource5" Runat="Server"
DataTextField="OpportunityStatus" DataValueField="OpportunityStatusID"
SelectedValue='<%# Bind("OpportunityStatusID") %>'/>
</td>
<td width="100px" align="right">
<asp:label
id="lblDateWonOrLost3" Runat="server" SkinID="Main">Date Won Or Lost
:</asp:label>
</td>
<td width="100px">
<asp:Label ID="lblDateWonOrLost"
runat="server" Text='<%# Bind("DateWonOrLost") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="100px" align="right"
valign="top">
<asp:label id="lblDescription3"
Runat="server" SkinID="Main">Description :</asp:label>
</td>
<td colspan="3">
<asp:TextBox ID="txtDescription"
Text='<%# Bind("Description") %>' runat="server"
TextMode="MultiLine" Rows="10"
Columns="50"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtDescription" Display="None" ErrorMessage="Please
enter a Description" />
</td>
</tr>
<tr>
<td>
<asp:ImageButton ID="btnUpdate"
runat="server" ImageUrl="~/Images/btnUpdate.jpg" CommandName="Update" />
<asp:ImageButton ID="btnCancel"
runat="server" ImageUrl="~/Images/btnCancel.jpg" CommandName="Cancel" />
</td>
</tr>
</table>
</EditItemTemplate>
The error I get is :
'Procedure or function UpdateOpportunity2 has too many arguments
specified'
Yet this is exactly the same sproc as I am using in a DetailView with
the same parameters which works fine.
Does anybody know why this is happening?
Regards,
Mike
detailsview, but I get an error when I try to update when editing the
formview. Here are my update parameters :
<UpdateParameters>
<asparameter Name="ProductTypeID"
Type="Int32" />
<asparameter Name="OpportunityTypeID"
Type="Int32" />
<asparameter Name="MonetaryValue"
Type="Double" />
<asparameter Name="ProbabilityID"
Type="Int32" />
<asparameter Name="Location" Type="String"
/>
<asparameter Name="OpportunityStatusID"
Type="Int32" />
<asparameter Name="Description"
Type="String" />
<asparameter Name="OpportunityID"
Type="Int32" />
</UpdateParameters>
And the EditItemTemplate :
<EditItemTemplate>
<table width="500">
<tr>
<td width="100px" align="right">
<asp:label
id="lblOpportunityID3" Runat="server" SkinID="Main">Opportunity ID
:</asp:label>
</td>
<td width="100px">
<asp:Label
ID="lblOpportunityID4" runat="server" Text='<%# Bind("OpportunityID")
%>'></asp:Label>
</td>
<td width="100px" align="right">
<asp:label id="lblProductType3"
Runat="server" SkinID="Main">Product Type :</asp:label>
</td>
<td width="100px">
<aspropDownList
ID="ddlProductType" runat="server" DataSourceID="SqlDataSource2"
DataTextField="ProductType"
DataValueField="ProductTypeID"
SelectedValue='<%#
Bind("ProductTypeID") %>'></aspropDownList>
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label
id="lblOpportunityType3" Runat="server" SkinID="Main">Opportunity Type
:</asp:label>
</td>
<td width="100px">
<aspropDownList
id="ddlOpportunityType" DataSourceID="SqlDataSource3" Runat="Server"
DataTextField="OpportunityType"
DataValueField="OpportunityTypeID" SelectedValue='<%#
Bind("OpportunityTypeID") %>'/>
</td>
<td width="100px" align="right">
<asp:label id="lblValue3"
Runat="server" SkinID="Main">Value (£) :</asp:label>
</td>
<td width="100px">
<asp:TextBox ID="txtValue"
Text='<%# Bind("MonetaryValue") %>' runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtValue"
Display="None" ErrorMessage="Please enter a Value" />
<asp:RangeValidator
ID="RangeValidator1" runat="server"
ControlToValidate="txtValue"
Type="Double" MaximumValue="4000000"
MinimumValue="0" Display="None"
ErrorMessage="Value must be numeric" />
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label id="lblProbability3"
Runat="server" SkinID="Main">Probability (%) :</asp:label>
</td>
<td width="100px">
<aspropDownList
id="ddlProbability" DataSourceID="SqlDataSource4" Runat="Server"
DataTextField="Probability"
DataValueField="ProbabilityID" SelectedValue='<%# Bind("ProbabilityID")
%>'/>
</td>
<td width="100px" align="right">
<asp:label id="lblLocation3"
Runat="server" SkinID="Main">Location :</asp:label>
</td>
<td width="100px">
<asp:TextBox ID="txtLocation"
Text='<%# Bind("Location") %>' runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ControlToValidate="txtLocation"
Display="None" ErrorMessage="Please enter a Location" />
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label id="lblCompanyName3"
Runat="server" SkinID="Main">Company Name :</asp:label>
</td>
<td width="100px">
<asp:Label ID="lblCompanyName"
runat="server" Text='<%# Bind("CompanyName") %>'></asp:Label>
</td>
<td width="100px" align="right">
<asp:label id="lblDateCreated3"
Runat="server" SkinID="Main">Date Created :</asp:label>
</td>
<td width="100px">
<asp:Label ID="lblDateCreated"
runat="server" Text='<%# Bind("DateCreated") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label id="lblStatus3"
Runat="server" SkinID="Main">Status :</asp:label>
</td>
<td width="100px">
<aspropDownList
id="ddlOpportunityStatus" DataSourceID="SqlDataSource5" Runat="Server"
DataTextField="OpportunityStatus" DataValueField="OpportunityStatusID"
SelectedValue='<%# Bind("OpportunityStatusID") %>'/>
</td>
<td width="100px" align="right">
<asp:label
id="lblDateWonOrLost3" Runat="server" SkinID="Main">Date Won Or Lost
:</asp:label>
</td>
<td width="100px">
<asp:Label ID="lblDateWonOrLost"
runat="server" Text='<%# Bind("DateWonOrLost") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="100px" align="right"
valign="top">
<asp:label id="lblDescription3"
Runat="server" SkinID="Main">Description :</asp:label>
</td>
<td colspan="3">
<asp:TextBox ID="txtDescription"
Text='<%# Bind("Description") %>' runat="server"
TextMode="MultiLine" Rows="10"
Columns="50"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtDescription" Display="None" ErrorMessage="Please
enter a Description" />
</td>
</tr>
<tr>
<td>
<asp:ImageButton ID="btnUpdate"
runat="server" ImageUrl="~/Images/btnUpdate.jpg" CommandName="Update" />
<asp:ImageButton ID="btnCancel"
runat="server" ImageUrl="~/Images/btnCancel.jpg" CommandName="Cancel" />
</td>
</tr>
</table>
</EditItemTemplate>
The error I get is :
'Procedure or function UpdateOpportunity2 has too many arguments
specified'
Yet this is exactly the same sproc as I am using in a DetailView with
the same parameters which works fine.
Does anybody know why this is happening?
Regards,
Mike