アクセスデータベースからのデータを表示する単純なc#アプリケーションがあります
private void DisplayRow(int rowIndex)
{
// Check that we can retrieve the given row
if (myDataTable.Rows.Count == 0)
return; // nothing to display
if (rowIndex >= myDataTable.Rows.Count)
return; // the index is out of range
// If we get this far then we can retrieve the data
try
{
DataRow row = myDataTable.Rows[rowIndex];
SurnametextBox.Text = row["Surname"].ToString();
FirstNametextBox.Text = row["Firstname"].ToString();
PhonetextBox.Text = row["Phone"].ToString();
ContactTypetextBox.Text = row["ContactType"].ToString();
}
catch (Exception ex)
{
MessageBox.Show("Error in DisplayRow : \r\n" + ex.Message);
}
}
データベースの最初のレコードが表示されるようになりました。これで、データをクリックするために次へボタンと戻るボタンが配置されましたが、次のレコードを表示するにはどのコードが必要ですか?