Menu

#460 [ADO.NET] CUBRIDDataAdapter.Update() does not work

open
nobody
None
5
2013-03-20
2013-03-20
Jira Trac
No

Because there is a property named CUBRIDDataAdapter.UpdateCommand, I think the CUBRIDDataAdapter.Update() may work in this way:
(1) prepare data:
create table t (id int, name varchar(100));
insert into t values (1, 'Nancy');

(2) fill data table
string sql = select * from t;
CUBRIDCommand cmd = new CUBRIDCommand(sql, conn);
adapter.SelectCommand = cmd;
DataTable dt = new DataTable(student);
adapter.Fill(dt);

(3) update the data table
sql = update t set name='Mandy' where id=1;
cmd = new CUBRIDCommand(sql, conn);
adapter.UpdateCommand=cmd;
adapter.Update(dt);

Expected Results:
The data table is updated

Actual results:
The data table is not updated

If the test case is wrong, then how to use the property CUBRIDDataAdapter.UpdateCommand? What is it designed for?

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.