Solved

Visual Basic Data Table

Posted on 2011-03-13
3
333 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Assisted Solution

by:John Gates, CISSP
John Gates, CISSP 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.
0
 
LVL 29

Accepted Solution

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

Author Closing Comment

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

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

691 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