updating formview

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>
<asp:parameter Name="ProductTypeID"
Type="Int32" />
<asp:parameter Name="OpportunityTypeID"
Type="Int32" />
<asp:parameter Name="MonetaryValue"
Type="Double" />
<asp:parameter Name="ProbabilityID"
Type="Int32" />
<asp:parameter Name="Location" Type="String"
/>
<asp:parameter Name="OpportunityStatusID"
Type="Int32" />
<asp:parameter Name="Description"
Type="String" />
<asp:parameter 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">
<asp:DropDownList
ID="ddlProductType" runat="server" DataSourceID="SqlDataSource2"
DataTextField="ProductType"
DataValueField="ProductTypeID"
SelectedValue='<%#
Bind("ProductTypeID") %>'></asp:DropDownList>
</td>
</tr>
<tr>
<td width="100px" align="right">
<asp:label
id="lblOpportunityType3" Runat="server" SkinID="Main">Opportunity Type
:</asp:label>
</td>
<td width="100px">
<asp:DropDownList
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">
<asp:DropDownList
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">
<asp:DropDownList
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top