0
CRUD in C# is not throwing integrity breach error while deleting BD Sqlite dependent record.
query = "DELETE FROM "+ table +
" WHERE id = '" + id + "';";
int returnValue = 0;
try
{
conn = new SQLiteConnection(connStr);
conn.Open();
cmd = conn.CreateCommand();
cmd.CommandText = query;
returnValue = cmd.ExecuteNonQuery();
conn.Close();
}
catch (Exception e)
{
MessageBox.Show("O seguinte erro está impedindo o correto " +
"funcionamento do aplicativo: \r\n" + e.Message);
}
When I delete a client that has dependent records no error is thrown. In Sqlite Studio you can notice that the Client has been deleted but the dependent record still has the inherited client key. Another observation is that the return value of Executenonquery() is always 1.