Linq To Sql - DataContext.SubmitChanges() problem

Posted by Ahmet Altun on Stack Overflow See other posts from Stack Overflow or by Ahmet Altun
Published on 2010-05-02T22:29:34Z Indexed on 2010/05/02 22:37 UTC
Read the original article Hit count: 614

Filed under:
|

I have a code like this.

DBContext is Datacontext instance.

try
            {
                TBLORGANISM org = new TBLORGANISM();
                org.OrganismDesc = p.Subject;
                DBContext.TBLORGANISMs.InsertOnSubmit(org);
                DBContext.SubmitChanges();
            }
            catch (Exception)
            {
            }

At this point, I want to IGNORE the error and want to be skipped. Not to be retried. But when I try another insert like

                TBLACTION act = new TBLACTION();
                act.ActionDesc = p.ActionName;
                DBContext.TBLACTIONs.InsertOnSubmit(act);
                DBContext.SubmitChanges();

SubmitChanges firstly retries previous attempt.

How can I tell "skip errors, don't try again"?

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about submitchanges