Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Parameters problem in FormView when updating.

Posted on 2010-09-17
4
Medium Priority
?
282 Views
Last Modified: 2013-11-05
Hi When I click Update in Edit mode, I get the following error:

Procedure or function spSBCCUpdateCompanyDetails has too many arguments specified. I have triple checked but the parameters are correct except, however when I Debug and step through using the code below, it is going through my set of update parameters twice!  The first set says "" for each one but when it gets to the next set, they all have values.

    protected void SqlDataSource1_Updating(object sender, SqlDataSourceCommandEventArgs e)
    {
        DbParameterCollection CmdParams = e.Command.Parameters;
        string paramValue = "";
        string paramName = "";
 
        if (CmdParams != null || CmdParams.Count > 0)
        {
            foreach (DbParameter cp in CmdParams)
            {
                if (cp.Value != null)
                    paramValue = cp.Value.ToString();
                else
                    paramValue = "";
                paramName = cp.ParameterName;
                Trace.Warn(paramName, paramValue);
            }
        }
    }

I am totally confused by this but just starting out with .Net 2.0 so I may have missed something - I attach my code and hope someone can help me resolve this.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="Stylesheet" href="adminStyles.css" type="text/css">
    <script language="javascript" type="text/javascript">
    function PopupPicker(ctl,w,h) {
        var PopupWindow=null;
        settings="width="+ w+",height="+h+",location=no,directories=no,";
        settings+="menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,dependent=no";
        PopupWindow=window.open('DatePicker.aspx?Ctl=' + ctl,'DatePicker',settings);
        PopupWindow.focus();
    }
</script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:FormView ID="FormView1" runat="server" CellPadding="4" 
            DataKeyNames="CompanyID" DataSourceID="SqlDataSource1" ForeColor="#333333">
            <FooterStyle BackColor="#F7F6F3" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <EditRowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <EditItemTemplate>          
            <div class="frmCoDetails">
            <b>Company Details:</b><br />
            CompanyName:
                <asp:TextBox ID="txtCompanyName" runat="server" Text='<%# Bind("CompanyName") %>' />
                <br />
                Nearest Town:
                <asp:Label ID="lblTownName" runat="server" Text='<%# Bind("Town_Name") %>' />
                    <br />
                Main Contact:
                <asp:Label ID="txtForename" runat="server" Text='<%# Bind("Forename") %>' />
                <asp:Label ID="txtSurname" runat="server" Text='<%# Bind("Surname") %>' />
                <br />                
                Website:
                <asp:TextBox ID="txtWebsite" runat="server" Text='<%# Bind("Website") %>' />
                <asp:RegularExpressionValidator ID="revWebsite" runat="server"     
                ErrorMessage="This is not a valid website address."  Display="Dynamic"
                ControlToValidate="txtWebsite" ValidationExpression="^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$" />
                <br />
                Sector:
                <asp:DropDownList ID="ddlSectors" runat="server" SelectedValue='<%# Bind("SectorID") %>'
                    DataSourceID="SqlDataSource1" DataTextField="SectorName" 
                    DataValueField="SectorID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ChamberConnectionString %>" 
                    SelectCommand="SBCCGetSectors" SelectCommandType="StoredProcedure">
                </asp:SqlDataSource>
                <asp:RequiredFieldValidator ID="rfvSector" runat="server"
                        ErrorMessage="Please select a Sector from the list." ControlToValidate="ddlSectors" Display="Dynamic">
                        </asp:RequiredFieldValidator>
                <br />                
                Number of Employees:
                <asp:TextBox ID="txtNumEmployees" runat="server" Text='<%# Bind("NumEmployees") %>' />
                <br />
                VS:
                <asp:CheckBox ID="cbVS" Checked='<%# Bind("VS") %>' runat="server" />
                &nbsp;&nbsp;&nbsp;&nbsp;
                SBSEC:
                <asp:CheckBox ID="cbSBSEC" Checked='<%# Bind("SBSEC") %>' runat="server" />
                &nbsp;&nbsp;&nbsp;&nbsp;
                TVTC:
                <asp:CheckBox ID="cbTVTC" Checked='<%# Bind("TVTC") %>' runat="server" />
                <br />
                BFN:
                <asp:CheckBox ID="cbBFN" Checked='<%# Bind("BFN") %>' runat="server" />
                &nbsp;&nbsp;&nbsp;&nbsp;
                HSS:
                <asp:CheckBox ID="cbHSS" Checked='<%# Bind("HSS") %>' runat="server" />
                &nbsp;&nbsp;&nbsp;&nbsp;
                SBEA:
                <asp:CheckBox ID="cbSBEA" Checked='<%# Bind("SBEA") %>' runat="server" />
                <br />
                Potential Event Venue:
                <asp:CheckBox ID="cbVenue" Checked='<%# Bind("Venue") %>' runat="server" />
                <br />
                Potential Speaker:
                <asp:CheckBox ID="cbSpeaker" Checked='<%# Bind("Speaker") %>' runat="server" />
                <br />               
                Company Notes:
                <asp:TextBox ID="txtCompanyNotes" runat="server" Text='<%# Bind("CompanyNotes") %>' />
                <br />
                </div>
                <div class="frmMemberDetails">
                <b>MEMBERSHIP DETAILS:</b><br />
                Status:
                <asp:DropDownList DataTextField="Status" DataValueField="StatusCode" ID="ddlStatus" Runat="server" SelectedValue='<%# Bind("StatusCode") %>' >
               <asp:ListItem Text="Select a Status" Value="0" />
               <asp:ListItem Text="Current Member" Value="1" />
               <asp:ListItem Text="Potential Member" Value="2" />
               <asp:ListItem Text="Lapsed Member" Value="3" />
               <asp:ListItem Text="Stakeholder" Value="4" />
               <asp:ListItem Text="Not Interested" Value="5" />
            </asp:DropDownList>
                         <asp:RequiredFieldValidator ID="rfvStatusCode" runat="server" InitialValue="0"
                        ErrorMessage="Please select a Status from the list." ControlToValidate="ddlStatus" Display="Dynamic">
                        </asp:RequiredFieldValidator>
                <br />
                 Source:
              <asp:DropDownList DataTextField="Source" DataValueField="SourceCode" ID="ddlSource" Runat="server" SelectedValue='<%# Bind("SourceCode") %>' >
               <asp:ListItem Text="Select a Source" Value="0" />
               <asp:ListItem Text="Business Gateway" Value="1" />
               <asp:ListItem Text="Enquiry" Value="2" />
               <asp:ListItem Text="Web enquiry" Value="3" />
               <asp:ListItem Text="Event" Value="4" />
               <asp:ListItem Text="VS" Value="5" />
               <asp:ListItem Text="SBSEC" Value="6" />
               <asp:ListItem Text="TVTC" Value="7" />
               <asp:ListItem Text="BFN" Value="8" />
               <asp:ListItem Text="HSS" Value="9" />
               <asp:ListItem Text="SBEA" Value="10" />
               <asp:ListItem Text="Referral" Value="11" />
            </asp:DropDownList>
                         <asp:RequiredFieldValidator ID="rfvSource" runat="server" InitialValue="0"
                        ErrorMessage="Please select a Source from the list." ControlToValidate="ddlSource" Display="Dynamic">
                        </asp:RequiredFieldValidator>
                <br />
                ShareData:
                <asp:CheckBox ID="cbShareData" Checked='<%# Bind("ShareData") %>' runat="server" />
                <br />
                DiscountMembership:
               <asp:DropDownList DataValueField="DiscountCode" ID="ddlDiscount" Runat="server" SelectedValue='<%# Bind("DiscountCode") %>' >
               <asp:ListItem Text="No Discount" Value="0" />
               <asp:ListItem Text="Business Gateway" Value="1" />               
               <asp:ListItem Text="BFN" Value="2" />
               <asp:ListItem Text="Contra" Value="3" />
               <asp:ListItem Text="HSS" Value="5" />              
               <asp:ListItem Text="SBEA" Value="6" />
               <asp:ListItem Text="SBSEC" Value="7" />
               <asp:ListItem Text="TVTC" Value="8" />
               <asp:ListItem Text="VS" Value="4" />
               <asp:ListItem Text="Other" Value="9" />
            </asp:DropDownList>
                <br />
                SBCC Rate:
                <asp:TextBox ID="txtSBCCRate" runat="server" Text='<%# Bind("SBCCRate") %>' />
                <asp:RegularExpressionValidator ID="revSBCCRate" runat="server" ErrorMessage="This is not a valid Rate."     
                Display="Dynamic" ControlToValidate="txtSBCCRate" 
                ValidationExpression="^\d+$" />
                <br />
                Date Joined:
                <asp:TextBox ID="txtJoinedDate" runat="server" Text='<%# Eval("JoinedDate", "{0:dd/MM/yyyy}") %>' />
                <asp:RegularExpressionValidator ID="revJoinedDate" runat="server" ErrorMessage="This is not a valid Date."     
                Display="Dynamic" ControlToValidate="txtJoinedDate" 
                ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$" />
                    <asp:LinkButton ID="LinkButton1" CausesValidation="false" OnClientClick="PopupPicker('txtJoinedDate', 250, 250);" runat="server">Pick</asp:LinkButton>
                    &nbsp;<br />
                Date Left: <asp:TextBox ID="txtDateLeft" runat="server" Text='<%# Bind("LeftDate") %>' />
                <asp:RegularExpressionValidator ID="revDateLeft" runat="server" ErrorMessage="This is not a valid Date."     
                Display="Dynamic" ControlToValidate="txtDateLeft" 
                ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$" />
                    <asp:LinkButton ID="LinkButton2" CausesValidation="false" OnClientClick="PopupPicker('txtDateLeft', 250, 250);" runat="server">Pick</asp:LinkButton>
                <br />               
                Amount (if paid):
                <asp:TextBox ID="txtAmountPaid" runat="server" Text='<%# Bind("AmountPaid") %>' />
                <asp:RegularExpressionValidator ID="revAmountPaid" runat="server"     
                ErrorMessage="This is not a valid amount."  Display="Dynamic"
                ControlToValidate="txtAmountPaid" ValidationExpression="^\d+(\.\d\d)?$" />
                <br />
                Amount Notes:
                <asp:TextBox ID="txtAmountNotes" runat="server" Text='<%# Bind("AmountNotes") %>' />
                <br />
                RenewalDate:
                <asp:TextBox ID="txtRenewalDate" runat="server" Text='<%# Bind("RenewalDate") %>' />
                <asp:RegularExpressionValidator ID="revRenewalDate" runat="server" ErrorMessage="This is not a valid Date."     
                Display="Dynamic" ControlToValidate="txtRenewalDate" 
                ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$" />
                <asp:LinkButton ID="LinkButton3" CausesValidation="false" OnClientClick="PopupPicker('txtRenewalDate', 250, 250);" runat="server">Pick</asp:LinkButton>
                    <br />
               Mentor:
                <asp:CheckBox ID="cbMentor" Checked='<%# Bind("Mentor") %>' runat="server" />
                <br />
                Mentee:
                <asp:CheckBox ID="cbMentee" Checked='<%# Bind("Mentee") %>' runat="server" />
                <br />
                Membership Notes:
                <asp:TextBox ID="txtMembNotes" runat="server" Text='<%# Bind("MembNotes") %>' />
                <br /><br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </div>
            </EditItemTemplate>
            <ItemTemplate>
            <div class="frmCoDetails">
            <b>COMPANY DETAILS:</b><br />
            <b>
                <asp:Label ID="CompanyNameLabel" runat="server" Text='<%# Bind("CompanyName") %>' /></b>
                <br />
                Nearest Town:
                <asp:Label ID="Town_NameLabel" runat="server" Text='<%# Bind("Town_Name") %>' />
                <br />
                Main Contact:
                <asp:Label ID="ForenameLabel" runat="server" Text='<%# Bind("Forename") %>' />
                &nbsp;
                <asp:Label ID="SurnameLabel" runat="server" Text='<%# Bind("Surname") %>' />
                <br />
                Website:
                <asp:Label ID="WebsiteLabel" runat="server" Text='<%# Bind("Website") %>' />
                <br />
                Sector:
                <asp:Label ID="SectorIDLabel" runat="server" Text='<%# Bind("SectorName") %>' />
                <br />
                Number of Employees:
                <asp:Label ID="NumEmployeesLabel" runat="server" Text='<%# Bind("NumEmployees") %>' />
                <br />      
                VS:
                <asp:Label ID="VSLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "VS").ToString())%>' />               
                &nbsp;&nbsp;&nbsp;
                SBSEC:
                <asp:Label ID="SBSECLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "SBSEC").ToString())%>' />
                 &nbsp;&nbsp;&nbsp;               
                TVTC:
                <asp:Label ID="TVTCLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "TVTC").ToString())%>' />
                <br />
                BFN:
                <asp:Label ID="BFNLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "BFN").ToString())%>' />
                &nbsp;&nbsp;&nbsp;
                HSS:
                <asp:Label ID="HSSLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "HSS").ToString())%>' />
                &nbsp;&nbsp;&nbsp;
                SBEA:
                <asp:Label ID="SBEALabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "SBEA").ToString())%>' />
                <br />
                Potential Event Venue:
                <asp:Label ID="VenueLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "Venue").ToString())%>' />
                <br />
                Potential Speaker:
                <asp:Label ID="SpeakerLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "Speaker").ToString())%>' />
                <br />
                Company Notes:<br />
                <asp:Label ID="NotesLabel" runat="server" Text='<%# Bind("CompanyNotes") %>' />
                <br />
                </div>
                <div class="frmMemberDetails">
                <b>MEMBERSHIP DETAILS:</b><br />                             
                Status:
                <asp:Label ID="StatusLabel" runat="server" Text='<%# Bind("StatusCode") %>' />
                <br />
                Source:
                <asp:Label ID="SourceLabel" runat="server" Text='<%# Bind("SourceCode") %>' />
                <br />
                Share Data?:
                <asp:Label ID="Label2" runat="server" 
                    Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "ShareData").ToString())%>' />
                <br />
                Membership Discount:
                <asp:Label ID="DiscountMembershipLabel" runat="server" 
                    Text='<%# displayDiscountOrigin(DataBinder.Eval(Container.DataItem, "DiscountCode").ToString())%>' />
                <br />
                SBCC Rate:
                <asp:Label ID="SBCCRateLabel" runat="server" Text='<%# Bind("SBCCRate") %>' />
                <br />
                Date Joined:
                <asp:Label ID="DateJoinedLabel" runat="server" 
                    Text='<%# Bind("JoinedDate","{0:dd/MM/yyyy}") %>' />
                <br />
                DateLeft:
                <asp:Label ID="DateLeftLabel" runat="server" Text='<%# Bind("LeftDate","{0:dd/MM/yyyy}") %>' />
                <br />
                Amount Paid:
                <asp:Label ID="AmountPaidLabel" runat="server" Text='<%# Bind("AmountPaid") %>' />
                <br />
                Amount Notes:
                <asp:Label ID="AmountNotesLabel" runat="server" 
                    Text='<%# Bind("AmountNotes") %>' />
                     <br />
                Renewal Date:
                <asp:Label ID="RenewalDateLabel" runat="server" 
                    Text='<%# Bind("RenewalDate") %>' />
                <br />
                Mentor:
                <asp:Label ID="MentorLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "Mentor").ToString())%>' />
                <br />
                Mentee:
                <asp:Label ID="MenteeLabel" runat="server" Text='<%# displayYesNo(DataBinder.Eval(Container.DataItem, "Mentee").ToString())%>' />
                <br />
                Membership Notes:<br />
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("MembNotes") %>' /><br />
                </div>
                <br /><br /><br />
                <asp:Button ID="Button1" runat="server" CommandName="Edit" Text="Edit" />
&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button2" runat="server" CommandName="Delete" Text="Delete" />
                &nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnShowcase" runat="server" Text="Add/Amend Showcase" />
            </ItemTemplate>
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
        </asp:FormView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" OnUpdating="SqlDataSource1_Updating"
            ConnectionString="<%$ ConnectionStrings:ChamberConnectionString %>" 
            SelectCommand="spSBCCGetCompanyDetails" SelectCommandType="StoredProcedure"
            UpdateCommand="spSBCCUpdateCompanyDetails" UpdateCommandType="StoredProcedure"
            DeleteCommand="spSBCCDeleteCompany" DeleteCommandType="StoredProcedure" >
            <SelectParameters>
                <asp:QueryStringParameter Name="companyID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
            <UpdateParameters>

            <asp:Parameter Name="txtCompanyName" Type="String" />         
            <asp:Parameter Name="txtWebsite" Type="String" /> 
            <asp:Parameter Name="ddlSectors" Type="Int32" /> 
            <asp:Parameter Name="txtNumEmployees" Type="String" /> 
            <asp:Parameter Name="cbVS" Type="boolean" />
            <asp:Parameter Name="cbSBSEC" Type="boolean" />
            <asp:Parameter Name="cbTVTC" Type="boolean" />
            <asp:Parameter Name="cbBFN" Type="boolean" />
            <asp:Parameter Name="cbHSS" Type="boolean" />
            <asp:Parameter Name="cbSBEA" Type="boolean" />
            <asp:Parameter Name="cbVenue" Type="boolean" />
            <asp:Parameter Name="cbSpeaker" Type="boolean" />
            <asp:Parameter Name="txtCompanyNotes" Type="String" />
            <asp:Parameter Name="ddlStatus" Type="Int32" />
            <asp:Parameter Name="ddlSource" Type="Int32" />
            <asp:Parameter Name="ddlDiscount" Type="Int32" />
            <asp:Parameter Name="txtSBCCRate" Type="String" /> 
            <asp:Parameter Name="txtJoinedDate" Type="DateTime" /> 
            <asp:Parameter Name="txtDateLeft" Type="DateTime" /> 
            <asp:Parameter Name="txtAmountPaid" Type="Decimal" />
            <asp:Parameter Name="txtAmountNotes" Type="String" />
            <asp:Parameter Name="txtRenewalDate" Type="DateTime" />
            <asp:Parameter Name="cbMentor" Type="boolean" /> 
            <asp:Parameter Name="cbMentee" Type="boolean" /> 
            <asp:Parameter Name="txtMembNotes" Type="String" />
            </UpdateParameters>  
        </asp:SqlDataSource>
        <br />
        
    
    </div>
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:Lorna70
  • 2
  • 2
4 Comments
 
LVL 41

Expert Comment

by:guru_sami
ID: 33702619
So the code you have in SqlDataSource1_Updating is for Test purpose only correct?

-->however when I Debug and step through using the code below, it is going through my set of update parameters twice!
So do you have any where in code-behind where you are explicitly calling SqlDataSource1.Update() method?
0
 

Author Comment

by:Lorna70
ID: 33703271
Hi Gura Sami

No I don't call it anywhere else.  I had a mistake in the parameters list.  However, when I print out with a Trace, I get:

@CompanyName Reston Ltd 0.672483164759767 0.670477
@Website http://www.reston.co.uk 1.45167213989487 0.779189
@SectorID 8 2.26096277599527 0.809291
@NumEmployees 2 3.74638019636574 1.485417
@VS False 4.53093689281738 0.784557
@SBSEC False 5.46206934121515 0.931132
@TVTC False 6.32517694287961 0.863108
@BFN False 7.2249913047608 0.899814
@HSS False 8.1384583096455 0.913467
@SBEA False 9.29768839335726 1.159230
@Venue False 10.1403943098913 0.842706
@Speaker False 11.2493844189695 1.108990
@CompanyNotes  12.2067894802272 0.957405
@StatusCode 1 13.2472835933059 1.040494
@SourceCode 11 14.3413101385791 1.094027
@DiscountCode 0 15.3472178726626 1.005908
@SBCCRate 100 16.1735101807632 0.826292
@JoinedDate  17.1086879058651 0.935178
@LeftDate  18.1527337273313 1.044046
@AmountPaid  19.4798839656996 1.327150
@AmountNotes  20.2281206130947 0.748237
@RenewalDate  20.9967467233964 0.768626
@Mentor False 21.7973421901387 0.800595
@Mentee False 23.438377992175 1.641036
@MembNotes  24.3269293304037 0.888551
@Town_Name Eyemouth 25.1195939707421 0.792665
@Forename Kenneth 25.8824078199883 0.762814
@Surname Walker 28.9455406343544 3.063133
@ShareData True 29.8806238642062 0.935083
@CompanyID 127

but my parameters are now:

            <UpdateParameters>
            <asp:Parameter Name="CompanyName" Type="String" />        
            <asp:Parameter Name="Website" Type="String" />
            <asp:Parameter Name="SectorID" Type="Int32" />
            <asp:Parameter Name="NumEmployees" Type="String" />
            <asp:Parameter Name="VS" Type="boolean" />
            <asp:Parameter Name="SBSEC" Type="boolean" />
            <asp:Parameter Name="TVTC" Type="boolean" />
            <asp:Parameter Name="BFN" Type="boolean" />
            <asp:Parameter Name="HSS" Type="boolean" />
            <asp:Parameter Name="SBEA" Type="boolean" />
            <asp:Parameter Name="Venue" Type="boolean" />
            <asp:Parameter Name="Speaker" Type="boolean" />
            <asp:Parameter Name="CompanyNotes" Type="String" />
            <asp:Parameter Name="StatusCode" Type="Int32" />
            <asp:Parameter Name="SourceCode" Type="Int32" />
            <asp:Parameter Name="DiscountCode" Type="Int32" />
            <asp:Parameter Name="SBCCRate" Type="String" />
            <asp:Parameter Name="JoinedDate" Type="DateTime" />
            <asp:Parameter Name="LeftDate" Type="DateTime" />
            <asp:Parameter Name="AmountPaid" Type="Decimal" />
            <asp:Parameter Name="AmountNotes" Type="String" />
            <asp:Parameter Name="RenewalDate" Type="DateTime" />
            <asp:Parameter Name="Mentor" Type="boolean" />
            <asp:Parameter Name="Mentee" Type="boolean" />
            <asp:Parameter Name="MembNotes" Type="String" />
            </UpdateParameters>

So it must be taking the extra parameters from my FormView:

@Town_Name Eyemouth 25.1195939707421 0.792665
@Forename Kenneth 25.8824078199883 0.762814
@Surname Walker 28.9455406343544 3.063133
@ShareData True 29.8806238642062 0.935083
@CompanyID 127

How is it doing this and why?
0
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 total points
ID: 33703702
So is it working now you mean?
If not, I think it is due to Bind method. If you are not going to update those items use Eval like below:

<asp:Label ID="lblTownName" runat="server" Text='<%# Eval("Town_Name") %>' />

Do that for other 3.
dont worry about @CompanyID as it will be sent implicitly and it is need for identifying the item you are trying to update.
0
 

Author Comment

by:Lorna70
ID: 33708281
Yes it is thanks - the extra parameters no longer appear now I've changed the controls for them to read Eval instead of Bind :-).
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question