0

ユーザーがデータをデータベースに保存するボタンをクリックすると、NorthwindDataSet に接続しようとしています。以下のコードを実行すると、エラーは発生しませんが、データは保存されません。DataSet に正しく接続していると思いますが、なぜこれが保存されないのかわかりません。

NorthwindDataSetTableAdapters.CustomersTableAdapter north = new NorthwindDataSetTableAdapters.CustomersTableAdapter();
NorthwindDataSet.CustomersDataTable northtable = north.GetData();

NorthwindDataSet northwindDataSet1 = new NorthwindDataSet();
NorthwindDataSet.CustomersRow newCustomersRow =
northwindDataSet1.Customers.NewCustomersRow();

newCustomersRow.CustomerID = "5";
newCustomersRow.CompanyName = "Alfreds Futterkiste";

northwindDataSet1.Customers.Rows.Add(newCustomersRow);

northwindDataSet1.Customers.AcceptChanges();
4

1 に答える 1