我正在嘗試生成rdlc報告,現在dataSet正在拋出異常。即「索引超出了陣列的界限」。ReportViewer,數組邊界外的索引(RDLC報告)C#
在命令視圖中,我在命令窗口中收到以下錯誤。
>? dataTable.GetErrors()[0]
'dataTable.GetErrors()[0]' threw an exception of type
'System.IndexOutOfRangeException'
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233080
HelpLink: null
IPForWatsonBuckets: {0}
InnerException: null
IsTransient: false
Message: "Index was outside the bounds of the array."
RemoteStackTrace: null
Source: null
StackTrace: null
TargetSite: null
WatsonBuckets: null
_HResult: -2146233080
_className: null
_data: {System.Collections.ListDictionaryInternal}
_dynamicMethods: null
_exceptionMethod: null
_exceptionMethodString: null
_helpURL: null
_innerException: null
_ipForWatsonBuckets: {0}
_message: "Index was outside the bounds of the array."
_remoteStackIndex: 0
_remoteStackTraceString: null
_safeSerializationManager: {System.Runtime.Serialization.SafeSerializationManager}
_source: null
_stackTrace: null
_stackTraceString: null
_watsonBuckets: null
_xcode: -532462766
_xptrs: {0}
歷史調試,指出對這些代碼
public virtual int Fill(ReportDataSet.DataTable1DataTable dataTable)
{
this.Adapter.SelectCommand = this.CommandCollection[0];
if ((this.ClearBeforeFill == true))
{
dataTable.Clear();
}
int returnValue = Adapter.Fill(dataTable);
return returnValue;
}
報告觀衆保持空白。有什麼建議麼?
它很可能是列,但很好嘗試 –
我只檢索9-11列的記錄,所以目前我只有1條記錄檢索,即1行。 – nix