473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [VendorArchive] ([Booth], [Deposit], [Rent], [Electric], [Security], [AmountPaid], [DatePaid], [PeriodPaid], [TotalDue], [Notes], [ArchiveDate], [BalanceDue], GETDATE());
  2.  
  3. SELECT Booth, Deposit, Rent, Electric, Security AmountPaid, DatePaid, PeriodPaid, TotalDue, BalanceDue, Notes
  4.  
  5. FROM Vendors 


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


Expand|Select|Wrap|Line Numbers
  1. private void vendorArchiveToolStripButton_Click(object sender, EventArgs e)
  2.  
  3.         {
  4.  
  5.             if (MessageBox.Show("Are you sure you wish to archive?", "Perform Archive", MessageBoxButtons.YesNo) == DialogResult.Yes)
  6.  
  7.             {
  8.  
  9.                 vendorArchiveTableAdapter.PerformArchive();
  10.  
  11.                 MessageBox.Show("Archive has completed.");
  12.  
  13.             }
  14.  
  15.  
  16.  
  17.         }
  18.  
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.
Jul 7 '10 #1
3 1499
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.
Jul 8 '10 #2
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 :

vendorArchiveTableAdapter.PerformArchive();

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.
Jul 8 '10 #3
Hi,

I am having a hard time with the terminolgy you are using. Please show the complete defintion of PerformArchive.
Jul 8 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: JP SIngh | last post by:
Hi All I am trying to write a recursive function to list the managers and his employees in a tree like sctructure Manager 1 Emp1 Emp1.1 Emp 1.2 Emp 2
3
by: | last post by:
Hello All, this is my first post. OK - The goal is to display the following (note: substitute 1' ' for 2'*') by using 3 recursive functions. 0123454321001234543210 **012343210012343210**...
2
by: | last post by:
OK: Purpose: Using user's input and 3 recursive functions, construct an hour glass figure. Main can only have user input, loops and function calls. Recursive function 1 takes input and displays...
1
by: Robert | last post by:
Vb.Net Make dll that contain one function. Help Please. I would like to call a function from different applications. I think i have to make a dll. I have Visual Basic.net 2003 Standard...
2
by: Goldie | last post by:
Can some please look at this function and maybe help me with why it's not doing as it's told... :) It's basicall meant to check to see if that field returned from database actually has any data...
2
by: TC | last post by:
IE only (V6). First, I know very little JS and our resident expert is short on time, so I come to you for help. I have a dynamic CGI script (written in Progress) that generates the following...
1
by: Abersparky | last post by:
Can someone help me with the mail() function??? The below is just to get myself going but I can't seem to get it working... is there something else I should be doing? I checked phpinfo() and the...
3
by: Lewe22 | last post by:
This is a function i have written to align a series of addresses for printing labels. However, for some reason the post code (A8) is not being moved up with the other address lines. I can't for...
5
by: turtle | last post by:
Background: I have a table of fields each field representing a month (Jan, Feb, Mar...). These are not a date field but more of a bucket to hold labor actuals. Along with the months their is...
0
by: kang jia | last post by:
hi currently i am doing this search function for car booking website. it can search through either car seats or CarModel. it seems it able to do search function, however i small problem occurs to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.