機能しない SQLAdapter.Update() に問題があります。
table = new DataTable();
mycommand = "select * from klient";
command = new SqlCommand();
command.CommandText = mycommand;
command.Connection = connection;
adapter = new SqlDataAdapter(command);
adapter.Fill(table);
data.ItemsSource = table.DefaultView;
(データはDataGridの名前です)
更新しようとすると、データベースに影響がありますが、データグリッドには影響しません
mycommand= "update klient set imie = 'ze'";
command.CommandText = mycommand;
adapter = new SqlDataAdapter();
SqlCommandBuilder builder = new SqlCommandBuilder(adapter);
adapter.UpdateCommand = command;
adapter.UpdateCommand.ExecuteNonQuery();
adapter.Update(table);
最後の行が機能していません。誰かがこれを整理するのに手を貸してくれますか?