D
Dan
This is more of an plea for help question. Before I go
into details, I am using Windows 2k, VS 2003, MySql Server
and an open source MySql .NET driver (MySqlDriverCS). (I
am aware that the fact that I am using an open source
driver could be the cause of my error).
I have checked many message boards about my error and have
found that people using Access, SQL Server, MySql, Oracle
all get this error and for similar reasons.
Error: Concurrency violation: the
DeleteCommand affected 0 records.
I receive the exception whenever I call the
DataAdapter.Update() method after marking DataTable Rows
for deletion.
My DeleteCommand.Text = "DELETE FROM mynames WHERE ID =
@ID"
I delete the Row, but doing a:
Dim key as new Integer(whatevermykeyis)
row = myTable.Rows.Find(key)
row.Delete()
Sometimes the row will be deleted from my Database,
sometimes it wont, but I still get the error no matter
what happens. After I get the exception I cannot do
anything else in my app and am forced to restart it.
What I believe could be the reason:
When add Parameters to mySqlCommands, I cannot add a size
property. Also, the datatypes do not properly match up
with MySql database types. In my database I used a
SmallInt(4) for my ID Column data type. But when I add
the parameters to my DeleteCommand, the best I can come up
with is DBType.Int16 (which is a 5 digit number).
Things I have tried:
1. Changed Database to NOT use a ID field and use a
varchar(16) field.
2. Changed my deleteCommand parameters from almost every
datatype I could, Int16, Int32,...
3. Changed my DeleteCommand String.
4. Many other changes to my code...etc
No matter what changes I do, I've always gotten that
exception. Can anyone fill me in, or give me some ideas
to try out. My database data doesnt change from the time
I Fill my DataSet to the time I Update my Database.
Thanks,
Dan
into details, I am using Windows 2k, VS 2003, MySql Server
and an open source MySql .NET driver (MySqlDriverCS). (I
am aware that the fact that I am using an open source
driver could be the cause of my error).
I have checked many message boards about my error and have
found that people using Access, SQL Server, MySql, Oracle
all get this error and for similar reasons.
Error: Concurrency violation: the
DeleteCommand affected 0 records.
I receive the exception whenever I call the
DataAdapter.Update() method after marking DataTable Rows
for deletion.
My DeleteCommand.Text = "DELETE FROM mynames WHERE ID =
@ID"
I delete the Row, but doing a:
Dim key as new Integer(whatevermykeyis)
row = myTable.Rows.Find(key)
row.Delete()
Sometimes the row will be deleted from my Database,
sometimes it wont, but I still get the error no matter
what happens. After I get the exception I cannot do
anything else in my app and am forced to restart it.
What I believe could be the reason:
When add Parameters to mySqlCommands, I cannot add a size
property. Also, the datatypes do not properly match up
with MySql database types. In my database I used a
SmallInt(4) for my ID Column data type. But when I add
the parameters to my DeleteCommand, the best I can come up
with is DBType.Int16 (which is a 5 digit number).
Things I have tried:
1. Changed Database to NOT use a ID field and use a
varchar(16) field.
2. Changed my deleteCommand parameters from almost every
datatype I could, Int16, Int32,...
3. Changed my DeleteCommand String.
4. Many other changes to my code...etc
No matter what changes I do, I've always gotten that
exception. Can anyone fill me in, or give me some ideas
to try out. My database data doesnt change from the time
I Fill my DataSet to the time I Update my Database.
Thanks,
Dan