これを機能させるには、いくつかのことが必要です。テーブルを [データ ソース] ビューからドラッグすると、GUI にいくつかの異なるものが表示されます。
- データセット
- bindingSource
- TableAdapter
- tableAdapterManager
- BindingNavigator
これらを配置したら、ソース コードを見て、舞台裏で何が起こっているかを確認できます。EndEdit が必要になります (Baldi が前に言ったように) が、もう少し必要です。
private void UpdateGridView()
{
// validate that data types corresponds to database table column
this.Validate();
// ends edit on the graph table
this.graphBindingSource.EndEdit();
// ends edit on the graph table
this.intervalBindingSource.EndEdit();
// connect to the database - and exceute changes
this.tableAdapterManager.UpdateAll(this.diagramDBDataSet);
}
うまくいけば、これで始められます。詳細については、この.NET データベース スライド ショーの補足的なデータベース チュートリアルを参照してください。幸運を!