By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,971 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,971 IT Pros & Developers. It's quick & easy.

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

P: 1
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
Share this Question
Share on Google+
1 Reply


kenobewan
Expert 2.5K+
P: 4,871
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.