Visual Basic Data Table

Posted on 2011-03-13
Last Modified: 2012-05-11
I have a DataSet that is giving me an error.  I am sure it is something silly, but I am missing it.  Thank you.

"Argument not specified for parameter 'PayCompanyFlag' of 'Public Overridable Function InsertAppraiserQuery(AppraiserID As Integer, ApprLastName As String, ApprFirstName As String, ApprCompanyName As String, ApprMailingAddress1 As String, ApprMailingAddress2 As String, ApprMailingCity As String, ApprMailingZip As String, ApprAddress1 As String, ApprAddress2 As String, ApprCity As String, ApprZip As String, AppraiserTaxID As String, ApprEmail As String, ApprEmail2 As String, ApprRanking As String, AppraiserNotes As String, ApprCompanyID As System.Nullable(Of Integer), ApprPhone1 As System.Nullable(Of Integer), ApprPhone2 As System.Nullable(Of Integer), ApprName As String, DateTimeAdded As System.Nullable(Of Date), ApprDesignation As String, PayCompanyFlag As System.Nullable(Of Boolean)) As Integer'.      C:\Users\denise\Documents\Visual Studio 2005\WebSites\proval1\DataUpload.aspx.vb      160      44      C:\...\proval1\

INSERT INTO VendorProfile
                  (VendorID, VendorLastName, VendorFirstName, VendorCompanyName, VendorMailingAddress1, VendorMailingAddress2, VendorMailingCity, VendorMailingZip, 
                  VendorAddress1, VendorAddress2, VendorCity, VendorZip, VendorTaxID, VendorEmail, VendorEmail2, VendorRanking, VendorNotes, VendorCompanyID, VendorPhone1, 
                  VendorPhone2, VendorName, VendorDateTimeAdded, VendorDesignation, VendorPayCompanyFlag)
VALUES (@AppraiserID,@ApprLastName,@ApprFirstName,@ApprCompanyName,@ApprMailingAddress1,@ApprMailingAddress2,@ApprMailingCity,@ApprMailingZip,@ApprAddress1,@ApprAddress2,@ApprCity,@ApprZip,@AppraiserTaxID,@ApprEmail,@ApprEmail2,@ApprRanking,@AppraiserNotes,@ApprCompanyID,@ApprPhone1,@ApprPhone2,@ApprName,@DateTimeAdded,@ApprDesignation,@PayCompanyFlag);   

---- return the VendorProfileKey

Open in new window

Protected Function ImportIntoVendorProfile(ByVal AppraiserID As String, ByVal ApprLastName As String, ByVal ApprFirstName As String, ByVal ApprCompanyName As String, ByVal ApprMailingAddress1 As String, ByVal ApprMailingAddress2 As String, ByVal ApprMailingCity As String, ByVal ApprMailingZip As String, ByVal ApprAddress1 As String, ByVal ApprAddress2 As String, ByVal ApprCity As String, ByVal ApprZip As String, ByVal ApprTaxID As String, ByVal ApprEmail As String, ByVal ApprEmail2 As String, ByVal ApprRanking As String, ByVal AppraiserNotes As String, ByVal ApprCompanyID As String, ByVal ApprPhone1 As String, ByVal ApprPhone2 As String, ByVal ApprName As String, ByVal PayCompanyFlag As Boolean, ByVal DateTimeAdded As String, ByVal ApprDesignation As String) As Integer

        Dim VendorID As Integer = 0

            Dim SSAdapter As New SSSAppraiserDataSetTableAdapters.VendorProfileTableAdapter
            Dim SSDataTable As SSSAppraiserDataSet.VendorProfileDataTable = Nothing
            SSDataTable = SSAdapter.GetVendorByID2(VendorID)

            If Not SSDataTable Is Nothing Then
                If SSDataTable.Rows.Count > 0 Then
                    If Not SSDataTable(0).VendorID = Nothing Then
                        VendorID = SSDataTable(0).VendorID
                        lblImport.Text = lblImport.Text & _
                  "<font color=blue>Member Found, Not Imported: " & _
                  " ID: " & VendorID & " " & ".</font><br>"
                    End If
                End If
            End If
            If VendorID = 0 Then
                ' retrieve the identity key member_id from the insert
                VendorID = Convert.ToInt32(SSAdapter.InsertAppraiserQuery(AppraiserID, ApprLastName, ApprFirstName, ApprCompanyName, ApprMailingAddress1, ApprMailingAddress2, ApprMailingCity, ApprMailingZip, ApprAddress1, ApprAddress2, ApprCity, ApprZip, ApprEmail, ApprEmail2, ApprRanking, AppraiserNotes, ApprCompanyID, ApprPhone1, ApprPhone2, ApprName, DateTimeAdded, ApprDesignation, PayCompanyFlag))
                lblImport.Text = lblImport.Text & _
                      "<font color=green>Member Imported: " & _
                      " ID: " & VendorID & " " & ApprLastName & " " & _
                      ApprFirstName & ".</font><br />"
            End If

            Return VendorID

        Catch ex As Exception
            lblImport.Text &= "<font color=red>" & ex.ToString & "</font><br />"
            Return 0

        End Try

    End Function

Open in new window

Question by:rcowen00
LVL 17

Assisted Solution

by:John Gates
John Gates earned 250 total points
ID: 35122929
What datatype are you declaring for @PayCompanyFlag ??  If this is a Boolean then the type should be bit and set to 1 for True and 0 for false.  If you are sending anything larger that is probably where the error is occurring.
LVL 29

Accepted Solution

Paul Jackson earned 250 total points
ID: 35124635
You are not passing the parameter @AppraiserTaxId into the SSAdapter.InsertAppraiserQuery. You have specified 23 parameters, 24 are required AppraiserTaxId is the one you are missing.

Author Closing Comment

ID: 35131879
It turned out to be a mixture of the 2 responses.  I wasn't passing a parameter and I had another field type incorrect.  Thank you..

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

947 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now