Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

ObjectDataSource 'SQLtblAB' could not find a non-generic method 'xUpdate' that has parameters:

I keep getting this and cannot seem to figue out the source of the problem. I have done other updates via this method, and they work.
<asp:ObjectDataSource ID="SQLtblAB" runat="server" InsertMethod="xInsert" SelectMethod="GettblAB"
        TypeName="tblAB" UpdateMethod="xUpdate" OldValuesParameterFormatString="{0}">
        <SelectParameters>
            <asp:ControlParameter ControlID="cmbAddressBookID" Name="tblABID" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:Parameter Name="tblABTCode" ConvertEmptyStringToNull="true" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="tblABReference" Type="String" />
            <asp:Parameter Name="tblABAddressTypeID" Type="Int32" />
            <asp:Parameter Name="tblABDefaultGeneralID" Type="Int32" />
            <asp:Parameter Name="tblABDefaultBillToID" Type="Int32" />
            <asp:Parameter Name="tblABDefaultShipToID" Type="Int32" />
            <asp:Parameter Name="tblABAccountingDetailsID" Type="Int32" />
            <asp:Parameter Name="tblABNotes" Type="String" />
            <asp:Parameter Name="tblABActive" Type="Boolean" />
            <asp:Parameter Name="tblABStatusID" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
             <asp:ControlParameter ControlID="cmbAddressBookID" Name="tblABID" PropertyName="SelectedValue"
              Type="Int32" />
            <asp:Parameter Name="tblABReference" Type="String" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABAddressTypeID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABDefaultGeneralID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABDefaultBillToID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABDefaultShipToID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABAccountingDetailsID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABEntryDate" Type="DateTime" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABNotes" Type="String" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABActive" Type="Boolean" />
            <asp:Parameter Name="tblABStatusID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABSalesTaxGroupID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABPurchasingTaxGroupID" Type="Int32" ConvertEmptyStringToNull="true" />           
            <asp:Parameter name="ConcurrencyID" Direction="InputOutput" Type="Int32" ConvertEmptyStringToNull="true"/>
            <asp:Parameter name="LastUpdate"  Type="DateTime" ConvertEmptyStringToNull="true"/>
            <asp:Parameter name="UpdateInitials"  Type="String" ConvertEmptyStringToNull="true"/>               
        </UpdateParameters>
    </asp:ObjectDataSource>
 
 
Code in Class
 
 
Public Function xUpdate(ByVal tblABID As Int32, ByVal tblABReference As String, ByVal tblABAddressTypeID As Int32, _
                                      ByVal tblABDefaultGeneralID As Int32, ByVal tblABDefaultBillToID As Int32, _
                                      ByVal tblABDefaultShipToID As Int32, ByVal tblABAccountingDetailsID As Int32, _
                                      ByVal tblABEntryDate As Date, ByVal tblABNotes As String, ByVal tblABActive As Boolean, _
                                      ByVal tblABStatusID As Int32, ByVal tblABSalesTaxGroupID As Int32, ByVal tblABPurchasingTaxGroupID As Int32, _
                                      ByVal ConcurrecyID As Int32, ByVal LastUpdate As Date, ByVal UpdateInitials As String) As Int32
 
        cn.ConnectionString = cs
        cmd.Connection = cn
 
        cmd.CommandText = ("tblAB_INSERT")
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@tblABID", tblABID)
        cmd.Parameters.AddWithValue("@tblABReference", tblABReference.ToString())
        cmd.Parameters.AddWithValue("@tblABAddressTypeID", tblABAddressTypeID)
        cmd.Parameters.AddWithValue("@tblABDefaultGeneralID", tblABDefaultGeneralID)
        cmd.Parameters.AddWithValue("@tblABDefaultBillToID", tblABDefaultBillToID)
        cmd.Parameters.AddWithValue("@tblABDefaultShipToID", tblABDefaultShipToID)
        cmd.Parameters.AddWithValue("@tblABAccountingDetailsID", tblABAccountingDetailsID)
        cmd.Parameters.AddWithValue("@tblABEntryDate", tblABEntryDate.ToString())
        cmd.Parameters.AddWithValue("@tblABNotes", tblABNotes.ToString())
        cmd.Parameters.AddWithValue("@tblABActive", tblABActive)
        cmd.Parameters.AddWithValue("@tblABStatusID", tblABStatusID)
        cmd.Parameters.AddWithValue("@intConcurrecyID", ConcurrecyID)
        cn.Open()
        cmd.ExecuteNonQuery()
 
    End Function

Open in new window

0
mastersolutionsllc
Asked:
mastersolutionsllc
  • 4
2 Solutions
 
mastersolutionsllcAuthor Commented:
Mistakeon the code copy

Public Function xUpdate(ByVal tblABID As Int32, ByVal tblABReference As String, ByVal tblABAddressTypeID As Int32, _
                                      ByVal tblABDefaultGeneralID As Int32, ByVal tblABDefaultBillToID As Int32, _
                                      ByVal tblABDefaultShipToID As Int32, ByVal tblABAccountingDetailsID As Int32, _
                                      ByVal tblABEntryDate As Date, ByVal tblABNotes As String, ByVal tblABActive As Boolean, _
                                      ByVal tblABStatusID As Int32, ByVal tblABSalesTaxGroupID As Int32, ByVal tblABPurchasingTaxGroupID As Int32, _
                                      ByVal ConcurrecyID As Int32, ByVal LastUpdate As Date, ByVal UpdateInitials As String) As Int32

        cn.ConnectionString = cs
        cmd.Connection = cn

        cmd.CommandText = ("tblAB_INSERT")
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.AddWithValue("@tblABID", tblABID)
        cmd.Parameters.AddWithValue("@tblABReference", tblABReference.ToString())
        cmd.Parameters.AddWithValue("@tblABAddressTypeID", tblABAddressTypeID)
        cmd.Parameters.AddWithValue("@tblABDefaultGeneralID", tblABDefaultGeneralID)
        cmd.Parameters.AddWithValue("@tblABDefaultBillToID", tblABDefaultBillToID)
        cmd.Parameters.AddWithValue("@tblABDefaultShipToID", tblABDefaultShipToID)
        cmd.Parameters.AddWithValue("@tblABAccountingDetailsID", tblABAccountingDetailsID)
        cmd.Parameters.AddWithValue("@tblABEntryDate", tblABEntryDate.ToString())
        cmd.Parameters.AddWithValue("@tblABNotes", tblABNotes.ToString())
        cmd.Parameters.AddWithValue("@tblABActive", tblABActive)
        cmd.Parameters.AddWithValue("@tblABStatusID", tblABStatusID)
        cmd.Parameters.AddWithValue("@intConcurrecyID", ConcurrecyID)
        cn.Open()
        cmd.ExecuteNonQuery()

    End Function
0
 
mastersolutionsllcAuthor Commented:
<asp:ObjectDataSource ID="SQLtblAB" runat="server" InsertMethod="xInsert" SelectMethod="GettblAB"
        TypeName="tblAB" UpdateMethod="xUpdate" OldValuesParameterFormatString="{0}">
        <SelectParameters>
            <asp:ControlParameter ControlID="cmbAddressBookID" Name="tblABID" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:Parameter Name="tblABTCode" ConvertEmptyStringToNull="true" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="tblABReference" Type="String" />
            <asp:Parameter Name="tblABAddressTypeID" Type="Int32" />
            <asp:Parameter Name="tblABDefaultGeneralID" Type="Int32" />
            <asp:Parameter Name="tblABDefaultBillToID" Type="Int32" />
            <asp:Parameter Name="tblABDefaultShipToID" Type="Int32" />
            <asp:Parameter Name="tblABAccountingDetailsID" Type="Int32" />
            <asp:Parameter Name="tblABNotes" Type="String" />
            <asp:Parameter Name="tblABActive" Type="Boolean" />
            <asp:Parameter Name="tblABStatusID" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
             <asp:ControlParameter ControlID="cmbAddressBookID" Name="tblABID" PropertyName="SelectedValue"
              Type="Int32" />
            <asp:Parameter Name="tblABReference" Type="String" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABAddressTypeID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABDefaultGeneralID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABDefaultBillToID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABDefaultShipToID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABAccountingDetailsID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABEntryDate" Type="DateTime" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABNotes" Type="String" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABActive" Type="Boolean" />
            <asp:Parameter Name="tblABStatusID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABSalesTaxGroupID" Type="Int32" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABPurchasingTaxGroupID" Type="Int32" ConvertEmptyStringToNull="true" />          
            <asp:Parameter name="ConcurrencyID" Direction="InputOutput" Type="Int32" ConvertEmptyStringToNull="true"/>
            <asp:Parameter name="LastUpdate"  Type="DateTime" ConvertEmptyStringToNull="true"/>
            <asp:Parameter name="UpdateInitials"  Type="String" ConvertEmptyStringToNull="true"/>              
        </UpdateParameters>
    </asp:ObjectDataSource>
0
 
Bob LearnedCommented:
If you have parameters like this:

           <asp:Parameter Name="tblABReference" Type="String" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="tblABAddressTypeID" Type="Int32" ConvertEmptyStringToNull="true" />

then, you need to reverse the arguments for 'xUpdate', or the types won't match:

  Public Function xUpdate(ByVal tblABReference As String, ByVal tblABID As Int32...
0
 
mastersolutionsllcAuthor Commented:
Reverse what?
0
 
mastersolutionsllcAuthor Commented:
I figured it out myself. Spelling error in one of the variables intconcurrency (it was spelled intconcurrecy)

I don know how to close the question. Funny how I got no input until I cancelled my trial offer ,a nd within 2 minutes of cancelling got someone to answer. But I got it anyhow.
0

Featured Post

Technology Partners: 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!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now