Concurrency violation problem on dataset update
Posted by:
Wina Bike
Date: December 09, 2005 04:45AM
Hi,
I have a _BIG_ problem with updating datasets. The DELETE and UPDATE command fail with "Concurrency violation: the DeleteCommand affected 0 records." When I delete row in the datagrid which contains eather FLOAT or BLOB (binary) field. If there are no float or blob fields everything works ok. As well, eveything works ok even if I enter an integer value in the float field. But if there is a float value in the float field it fails.
Don't know what to do... Thanx in advance for help.
MySQL is 5.0.15 version, mysql connector for net is 1.0.6
The code is following:
//connection string
string kstr;
kstr = "Persist Security Info=False;database=katastar;server=server2;user id=root;Password=mypass;CHARSET=utf8 ";
myconnection = new MySqlConnection(kstr);
//filling dataset and seting grid's datasource
myconnection .Open();
DA = new MySqlDataAdapter("SELECT * FROM test", myconnection );
MySql.Data.MySqlClient.MySqlCommandBuilder CB = new MySqlCommandBuilder(DA);
DA.InsertCommand = CB.GetInsertCommand();
DA.UpdateCommand = CB.GetUpdateCommand();
DA.DeleteCommand = CB.GetDeleteCommand();
DS = new DataSet();
DA.Fill(DS, "test");
DataTable DT = DS.Tables["test"];
grid.DataSource = DT;
//update dataset with data from grid
DataTable DTU = (DataTable)(grid.DataSource);
DataSet DSN = DTU.DataSet;
DA.Update(DSN, "test"); //<- it fails here!!!
Subject
Written By
Posted
Concurrency violation problem on dataset update
December 09, 2005 04:45AM
December 12, 2005 03:22AM
February 01, 2006 06:35AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.