473,671 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is this error: Invalid number of arguments: function convert().

1 New Member
Dear All

When I try to use convert function of MS sql server like this:

String sql = " (employee_id = '" + employee_id + "') and ((convert(VARCH AR,w_date,103) = '" + w_date + "'))";

PAYROLLDataSet. WORKINGTIMESRow[] workingtime_row = (PAYROLLDataSet .WORKINGTIMESRo w[])pAYROLLDataSet .WORKINGTIMES.S elect(sql);


Whe I run, it rais bellow exception:

Could any one tell me why. Thanks

Invalid number of arguments: function convert().
at System.Data.Fun ctionNode.Bind( DataTable table, List`1 list)
at System.Data.Bin aryNode.Bind(Da taTable table, List`1 list)
at System.Data.Una ryNode.Bind(Dat aTable table, List`1 list)
at System.Data.Una ryNode.Bind(Dat aTable table, List`1 list)
at System.Data.Bin aryNode.Bind(Da taTable table, List`1 list)
at System.Data.Dat aExpression.Bin d(DataTable table)
at System.Data.Dat aExpression..ct or(DataTable table, String expression, Type type)
at System.Data.Sel ect..ctor(DataT able table, String filterExpressio n, String sort, DataViewRowStat e recordStates)
at System.Data.Dat aTable.Select(S tring filterExpressio n)
at payroll.FrmImpo rt.updateOrAddW orkingTime(Stri ng employee_id, String w_date, String hours_early, String hours_late, String basic_hours, String extra_hours1, String extra_hours2) in D:\pnbaocuong\s 3s.com.vn\Quan ly tien luong\source\pa yroll\payroll\F rmImpot.cs:line 255
at payroll.FrmImpo rt.AddPayrollFr omExcel(String sttrFilePath) in D:\pnbaocuong\s 3s.com.vn\Quan ly tien luong\source\pa yroll\payroll\F rmImpot.cs:line 86}
Jan 20 '08 #1
1 6073
kenobewan
4,871 Recognized Expert Specialist
You need to review how sql statements work, try here:
SQL Tutorial
Jan 20 '08 #2

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

Similar topics

5
2827
by: titan0111 | last post by:
#include<iostream> #include<iomanip> #include<cstring> #include<fstream> using namespace std; class snowfall { private: int ft;
17
1777
by: Adam | last post by:
Hi! I've modified a javascript order form calculation script that tallies up the subtotal, shipping/handling, and total automatically. I did some modifications and it still worked fine, even in Netscape, but at some point the Shipping/Handling field has ceased to display correctly in that browser, showing a Not A Number error. (In Safari it looks fine, and it calculates correctly in all browsers I've tested it with.)
6
23530
by: WindAndWaves | last post by:
Hi Folks I have inhereted a script that I understand reasonably well, I just do not understand !/^\d+$/.test(el.value) what the hell does that mean? Below is the script (there are really three and they validate a four items
3
2739
by: windandwaves | last post by:
Hi Gurus Does anyone know how I set the error trapping to option 2 in visual basic. I know that you can go to tools, options and then choose on unhandled errors only, but is there a VB command that I can use instead? Cheers Nicolaas
24
2951
by: Romeo Colacitti | last post by:
Hi, Does anyone here have a strong understanding for the meanings of the terms "lvalue" and "rvalue" as it pertains to C, objects, and different contexts? If so please share. I've been reading several old posts/threads on the subject, and they never end with a conclusion (people keep correcting each other and disagreeing).
8
13018
by: werner | last post by:
Hi! I don't want to use eval() in order to parse a user-supplied formula. What alternatives do I have? PHP has no standard functionality for tokenizing or parsing expressions in this regard. Here is a simple example: The user supplies the following formula in string format, "a = (6+10)/4", and the script needs to find out what the value of 'a' is.
83
7810
by: deppy_3 | last post by:
Hi.I am started learning Programm language C before some time.I am trying to make a programm about a very simple "sell shop".This programm hasn't got any compile problem but when i run it i face some other ploblems which i can not correct.I would appreciated if someone take a look at my programm so as to help me.I tried many times to find out where my mistakes are but i didn't manage something. I have made some comments due to the programm...
0
2532
by: Pucca | last post by:
Hi I'm using vs2005. I am getting a bunch of compiler warnings after I made some changes to my code that was compiling clean. I'm also getting memory errors when I run my program and it's pinvoking some C++ code, which was working also fine before. I wonder if these warning are causing the problem. I would appreciate some help or suggestions on how to correct these. Thanks. Warning 37 At least one of the arguments for...
13
2405
by: mohi | last post by:
hello everyone, i use a function called minor to find the minor of an element of a matrix , i declare it as : float minor(float A,int m,int n,int i,int j);//find the minor in A and define it later in the file as :
0
8478
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8397
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8919
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8599
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7439
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.