string Query = "SELECT [AA], [TEXT] FROM [TABLE] WHERE FK_ML_PROGRAM=200 AND FK_ML_LANGUAGE=" + Convert.ToInt32(cboLanguage.SelectedIndex) + " AND AA like 'Msg_%' ORDER BY ID ";
LanguageData = DAL.ExecuteDataTable(Query);
private DataRow GetRows(string b)
{
DataRow[] result_start = LanguageData.Select("AA='" + b.ToString() + "'");
DataRow Row = result_start[0];
return Row;
}
當我運行該應用程序時,它會拋出一個IndexOutOfRangeException
。任何想法是什麼導致這一點?「IndexOutOfRangeException was unhandled」
最有可能您的結果集爲空,嘗試檢查result_start的長度,然後嘗試從中指定某些值。 –