469,077 Members | 1,383 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,077 developers. It's quick & easy.

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 5581
kenobewan
4,871 Expert 4TB
You need to review how sql statements work, try here:
SQL Tutorial
Jan 20 '08 #2

Post your reply

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

Similar topics

17 posts views Thread by Adam | last post: by
6 posts views Thread by WindAndWaves | last post: by
83 posts views Thread by deppy_3 | last post: by
13 posts views Thread by mohi | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.