SQL function help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oceantrain
    New Member
    • Feb 2010
    • 11

    SQL function help

    I am trying to archive a datagrid into a datatable so I can find it in the table by the archive date. I am using an INSERT SQL statement as follows:

    Code:
    INSERT INTO [VendorArchive] ([Booth], [Deposit], [Rent], [Electric], [Security], [AmountPaid], [DatePaid], [PeriodPaid], [TotalDue], [Notes], [ArchiveDate], [BalanceDue], GETDATE());
    
    SELECT Booth, Deposit, Rent, Electric, Security AmountPaid, DatePaid, PeriodPaid, TotalDue, BalanceDue, Notes
    
    FROM Vendors


    I then call the sql function in my code inside a button click event:


    Code:
    private void vendorArchiveToolStripButton_Click(object sender, EventArgs e)
    
            {
    
                if (MessageBox.Show("Are you sure you wish to archive?", "Perform Archive", MessageBoxButtons.YesNo) == DialogResult.Yes)
    
                {
    
                    vendorArchiveTableAdapter.PerformArchive();
    
                    MessageBox.Show("Archive has completed.");
    
                }
    
     
    
            }
    When i debug and hit the archive button I get this error: "No overload for method 'PerformArchive ' takes 0 arguments"

    I don't understand. Am I using the wrong SQL statement? Do I need to add all the columns as argumnets in the method call?

    Please help.
  • Christopher Nigro
    New Member
    • Jul 2010
    • 53

    #2
    The 'PerformArchive ' method expects you to pass one or more arguments with the call to it. You aren't passing any. If you don't understand this, show us the signature/defintion for the 'PerformArchive ' method.

    Comment

    • oceantrain
      New Member
      • Feb 2010
      • 11

      #3
      Thanks for responding Christopher. I was under the impression that I created the function/method in A SQL statement and was just calling it with :

      vendorArchiveTa bleAdapter.Perf ormArchive();

      The arguments in the SQL statement are (@p1, @p2, @p3 ect.) I did try to add those arguments in code but still no help. Do I need to define the method like any other as a SQL staement? Confused.

      Comment

      • Christopher Nigro
        New Member
        • Jul 2010
        • 53

        #4
        Hi,

        I am having a hard time with the terminolgy you are using. Please show the complete defintion of PerformArchive.

        Comment

        Working...