Oreo1982 0 Newbie Poster

Hi,
I have a web form that uses an objectdatasource to select and update the data that is displayed on a gridview. the select is working great, but the update keeps coming back with this.

" ObjectDataSource 'objdsIntake' could not find a non-generic method 'UpdateCompleted' that has parameters: Completed, LName, FName, Age, City, IntakeDate, HPhone, WPhone, IntakeType, IntakeId."

The problem is my update functions/storedprocedure only updates the "Completed" field. so it only has two parameters. The IntakeId and Completed.

I have also tried just updating the whole table. this also has weird effects. when the error comes up it always adds age to the list. Age is calculated in the select from the field DOB, but is not mentioned anywhere in the update statement. Also, when the error comes up the fields are out of order from anything i have in the code. Where would it be getting this order?

here is code:
aspx(gridview and object datasource)
(i originally had the fields that are not editable in boundfields, but when problems arose, i read somewhere i should change them to template fields.)

<asp:GridView ID="grdIntake" runat="server"  AllowPaging="true" 
PagerStyle-HorizontalAlign="center" DataSourceid="objdsIntake"
AutoGenerateColumns="False"  DataKeyNames="IntakeId"
BackColor="#E1ECFC" AlternatingRowStyle-BackColor="white" 
ForeColor="#3366CC" PageSize="10">
 <HeaderStyle BackColor="#FEF1B5" ForeColor="#3366CC" Font-Size="Small" />
                    <Columns>
                        <asp:CommandField ButtonType="button" ShowEditButton="true" >
                            <ControlStyle BackColor="#E1ECFC" ForeColor="#3366CC" />
                        </asp:CommandField >
                        <asp:BoundField DataField="IntakeId" Visible="false" />
                        <asp:TemplateField HeaderText="Last Name" HeaderStyle-Width="85px">
                            <EditItemTemplate>
                                <asp:Label ID="lbleLnam" runat="server" ForeColor="#3366CC" Text='<%# bind("LName") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbliLnam" runat="server" ForeColor="#3366CC" Text='<%# bind("LName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="First Name" HeaderStyle-Width="85px">
                            <EditItemTemplate>
                                <asp:Label ID="lbleFnam" runat="server" ForeColor="#3366CC" Text='<%# bind("FName") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbliFnam" runat="server" ForeColor="#3366CC" Text='<%# bind("FName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Age" HeaderStyle-Width="15px">
                            <EditItemTemplate>
                                <asp:Label ID="lbleAge" runat="server" ForeColor="#3366CC" Text='<%# bind("Age") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbliAge" runat="server" ForeColor="#3366CC" Text='<%# bind("Age") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="City" HeaderStyle-Width="100px">
                            <EditItemTemplate>
                                <asp:Label ID="lbleCity" runat="server" ForeColor="#3366CC" Text='<%# bind("City") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbliCity" runat="server" ForeColor="#3366CC" Text='<%# bind("City") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Intake Date" HeaderStyle-Width="75px">
                            <EditItemTemplate>
                                <asp:Label ID="lbleIntakeDate" runat="server" ForeColor="#3366CC" Text='<%# bind("IntakeDate", "{0:d}") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbliIntakeDate" runat="server" ForeColor="#3366CC" Text='<%# bind("IntakeDate", "{0:d}") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Home Phone" HeaderStyle-Width="105px">
                            <EditItemTemplate>
                                <asp:Label ID="lbleHPhone" runat="server" ForeColor="#3366CC" Text='<%# bind("HPhone") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbliHPhone" runat="server" ForeColor="#3366CC" Text='<%# bind("HPhone") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Work Phone" HeaderStyle-Width="105px">
                            <EditItemTemplate>
                                <asp:Label ID="lbleWPhone" runat="server" ForeColor="#3366CC" Text='<%# bind("WPhone") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbliWPhone" runat="server" ForeColor="#3366CC" Text='<%# bind("WPhone") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Type" HeaderStyle-Width="160px">
                            <EditItemTemplate>
                                <asp:Label ID="lbleIntakeType" runat="server" ForeColor="#3366CC" Text='<%# bind("IntakeType") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbliIntakeType" runat="server" ForeColor="#3366CC" Text='<%# bind("IntakeType") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Completed" HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="center">
                            <EditItemTemplate>
                                <asp:CheckBox ID="chkeCompleted" runat="server" checked='<%# bind("Completed") %>'/>
                                 </EditItemTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkiCompleted" runat="server" Enabled="false" checked='<%# bind("Completed") %>'/>
                            </ItemTemplate>
                        </asp:TemplateField>
                                               
                    </Columns>
                </asp:GridView>
                <asp:ObjectDataSource ID="objdsIntake" runat="server" SelectMethod="GetIntakes" UpdateMethod="UpdateCompleted"
                              TypeName="BEC.WebModules.MentalHealth.Business.MentalHealth">
                    <UpdateParameters>
                        <asp:Parameter Name="IntakeId" Type="int32" />                                              
                        <asp:Parameter Name="Completed" Type="boolean" />                        
                    </UpdateParameters>
                </asp:ObjectDataSource>

Here is the business function:

Public Function UpdateCompleted(ByVal IntakeId As Integer, ByVal Completed As Boolean) As Boolean
            Dim objdata As New BEC.WebModules.MentalHealth.Data.MentalHealth(strSQLConnectionString)
            Return objdata.UpdateCompleted(IntakeId, Completed)
        End Function

here is the data:

Public Function UpdateCompleted(ByVal pintIntakeId As Integer, ByVal pblnCompleted As Boolean) As Boolean
            Dim parameters As SqlParameter() = { _
                New SqlParameter("@IntakeId", SqlDbType.Int), _
                New SqlParameter("@Completed", SqlDbType.Bit)}

            parameters(0).Value = Null.GetNull(pintIntakeId)
            parameters(1).Value = Null.GetNull(pblnCompleted)

            Dim introwsaffected As Integer
            'replace stored procedure when finished with it.
            RunProcedure("HSIS.sp_MH_Intake_UpdateComplete", parameters, introwsaffected)

            Return CBool(introwsaffected = 1)
        End Function

and the stored procedure just contains a simple update statement.