I am working on a winforms c# 2010 application connecting to an MS ACCESS database.
occasionally, users are saying that they are having the same error 'could not update; currently locked'
so what I would like to do is catch this when it arises, wait a few seconds, then loop to try again until the database is updated.
how can I achieve this?
here is a snippet of the code to insert data:
foreach (string f in fields)
myFields += f + ", ";
myValues += "?,";
OleDbCommand cmd = new System.Data.OleDb.OleDbCommand("INSERT INTO " + table + " (" + myFields + ") Values (" + myValues + ") ", con);
foreach (string v in values)
cmd.CommandType = CommandType.Text;