Solved

Visual Basic Data Table

Posted on 2011-03-13
3
318 Views
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
SELECT SCOPE_IDENTITY()

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

        Try
            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

0
Comment
Question by:rcowen00
3 Comments
 
LVL 17

Assisted Solution

by:John Gates
John Gates earned 250 total points
Comment Utility
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.
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
Comment Utility
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.
0
 

Author Closing Comment

by:rcowen00
Comment Utility
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..
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

772 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

10 Experts available now in Live!

Get 1:1 Help Now