473,395 Members | 1,696 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.

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

Dear All

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

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

PAYROLLDataSet.WORKINGTIMESRow[] workingtime_row = (PAYROLLDataSet.WORKINGTIMESRow[])pAYROLLDataSet.WORKINGTIMES.Select(sql);


Whe I run, it rais bellow exception:

Could any one tell me why. Thanks

Invalid number of arguments: function convert().
at System.Data.FunctionNode.Bind(DataTable table, List`1 list)
at System.Data.BinaryNode.Bind(DataTable table, List`1 list)
at System.Data.UnaryNode.Bind(DataTable table, List`1 list)
at System.Data.UnaryNode.Bind(DataTable table, List`1 list)
at System.Data.BinaryNode.Bind(DataTable table, List`1 list)
at System.Data.DataExpression.Bind(DataTable table)
at System.Data.DataExpression..ctor(DataTable table, String expression, Type type)
at System.Data.Select..ctor(DataTable table, String filterExpression, String sort, DataViewRowState recordStates)
at System.Data.DataTable.Select(String filterExpression)
at payroll.FrmImport.updateOrAddWorkingTime(String employee_id, String w_date, String hours_early, String hours_late, String basic_hours, String extra_hours1, String extra_hours2) in D:\pnbaocuong\s3s.com.vn\Quan ly tien luong\source\payroll\payroll\FrmImpot.cs:line 255
at payroll.FrmImport.AddPayrollFromExcel(String sttrFilePath) in D:\pnbaocuong\s3s.com.vn\Quan ly tien luong\source\payroll\payroll\FrmImpot.cs:line 86}
Jan 20 '08 #1
1 6029
kenobewan
4,871 Expert 4TB
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
by: titan0111 | last post by:
#include<iostream> #include<iomanip> #include<cstring> #include<fstream> using namespace std; class snowfall { private: int ft;
17
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...
6
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...
3
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...
24
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...
8
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. ...
83
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...
0
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...
13
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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...

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.