0
我在生成報告時收到此錯誤。它說「索引(基於零)必須大於或等於零並小於參數列表的大小。」索引(基於零)必須大於或等於零且小於參數列表(VB.NET)的大小
我該如何解決這個問題?誰能幫我這個?我是vb.net編程的新手。提前致謝。
這是我的代碼:
If String.IsNullOrEmpty(reportFilter) Then
daEmployee.SetWhereClause(String.Format("cdr_site_id = '{0}' AND cdr_datetime BETWEEN '{1}' AND '{2}' AND cdr_call_class_code = 'OUTGOING' AND cdr_call_type_id IN({3}) AND a.employee_id IN({4}) group by cdr_date,cdr_time,cdr_call_type_code ORDER BY employee_name", siteId, employeeId))
Else
daEmployee.SetWhereClause(String.Format("cdr_site_id = '{0}' AND cdr_datetime BETWEEN '{1}' AND '{2}' AND cdr_call_class_code = 'OUTGOING' AND cdr_call_type_id IN({3}) AND a.employee_id IN({4}) group by cdr_date,cdr_time,cdr_call_type_code ORDER BY employee_name", siteId, employeeId))
End If
你'string.Format'需要5個參數({0} - {4}),而你只傳遞2. –