Book a Demo

Author Topic: DAOerror Updating Constraint.Name=0 to another val  (Read 3706 times)

pisokol

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
DAOerror Updating Constraint.Name=0 to another val
« on: June 16, 2015, 11:57:06 pm »
Hi,
In EAP I have the element with defined constraints. One of this constraints has constraint.name set to "0" (zero). In my addin (c#) I find this constraint and set constraint.name to another value ("A"). Next I try to update this constraint and I have the error
DAO.QueryDef [3075]
Syntax error (comma) in query expression ...
Finaly this update is working and this changes are stored in EAP.
My problem is, how can I catch this exception in my addin code, because this is error is shown in separate window and stoped whole proces.
Code: [Select]
EA.IDualElement el = Repository.GetElementByID(<Element.Element_ID>);
foreach (EA.IDualConstraint con in el.Constraints)
                    {

                        if (con.Name == "0")
                        {
                            con.Name = "A";
                            try
                            {
                                con.Update();
                            }
                            catch (Exception ex1)
                            {
                                MessageBox.Show("My Error" + Environment.NewLine +
                                    "Exception.Message" + Environment.NewLine +
                                    ex1.Message + Environment.NewLine +
                                    "Repository.GetLastError()" + Environment.NewLine +
                                    Repository.GetLastError() + Environment.NewLine +
                                    "");
                            }
                        }

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: DAOerror Updating Constraint.Name=0 to another
« Reply #1 on: June 17, 2015, 02:03:15 am »
There is no way of suppressing this error. If you can reproduce this you should contact Sparx support as it indicates an error in the API.

q.

pisokol

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: DAOerror Updating Constraint.Name=0 to another
« Reply #2 on: June 17, 2015, 06:34:31 pm »
thx