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}