StrataFrame Forum

IDE Error when editing PopulationDataSourceSettings property of SF ComboBoxEdit

http://forum.strataframe.net/Topic16939.aspx

By Randy Ayers - 6/9/2008

I'm trying to populate a combo box via a fill method of a business object.  When I click the "..." button of the PopulationDataSourceSettings property, I get the following error when SF is searching for all of the Business Objects:

ConstraintException
  Column 'value' is constrained to be unique.  Value 'BBS.Biz.Base.AuditBO' is already present.

Source     : System.Data

Stack Trace:
   at System.Data.UniqueConstraint.CheckConstraint(DataRow row, DataRowAction action)
   at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
   at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)
   at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos, Boolean fireEvent)
   at System.Data.DataRowCollection.Add(DataRow row)
   at MicroFour.StrataFrame.Extensibility.ListPopulationEditorDialog.ᜂ()
   at MicroFour.StrataFrame.Extensibility.ListPopulationEditorDialog.ᜁ(Object A_0, EventArgs A_1)

After I close the error message, the SF dialog is there, but with no Business Objects or methods to choose from.  Can someone please advise on what might be causing this error? Thanks in advance.

By Edhy Rijo - 6/9/2008

Hi Randy,

Try rebuilding your project first.  Also whenever you make a change to your BO, or when coming back from the Business Object Mapper (BOM) it is a good idea to rebuild your BO class library, or your solution, so all the typed changes are updated.

By Randy Ayers - 6/9/2008

Edhy,

Thanks for the suggestions.  I did try rebuilding my projects, but the same result occured. 

FWIW, I removed the .BusinessObject property that was being specified for the combo box and the error does not occur.  Any ideas? BigGrin

By Edhy Rijo - 6/9/2008

Randy,

Taking a second look at your error, it may be that you don't have the correct SF assemblies or something in that route.  If you have updated your copy of SF, make sure you also update the SF database from the installation, you can do this as many times as you want, just reinstall SF and select the checkbox to update your SF database. 

If that is the case, download the latest beta release which is pretty stable from the Posted Release forum.

P.S.

At this point I am just guessing based on the error, I am sure Trent or somebody else from SF Team will jump in and give you a direct answer, but there is nothing wrong with trying to reinstall SF.

By Trent L. Taylor - 6/10/2008

Well, the problem is that you have two business objects with the exact same name and namespace within your project.  It sounds like you have a reference within your application that has a BO with this name and namespace and then another within the project itself.  That is the only way I think that this could actually happen.  Regardless, you will need to resolve this within your application otherwise you are going to have a lot of issues with ambiguous references.
By Michael Reese - 6/17/2008

I am having the exact same issue. I searced through the entire project for a the duplicate BO without finding it? I know that I did not create a duplicate?

Any additional ideas?

ConstraintException
  Column 'value' is constrained to be unique.  Value 'Trax_System.aBOCustomer' is already present.

Source     : System.Data

Stack Trace:
   at System.Data.UniqueConstraint.CheckConstraint(DataRow row, DataRowAction action)
   at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
   at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)
   at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos, Boolean fireEvent)
   at System.Data.DataRowCollection.Add(DataRow row)
   at MicroFour.StrataFrame.Extensibility.ListPopulationEditorDialog.ᜂ()
   at MicroFour.StrataFrame.Extensibility.ListPopulationEditorDialog.ᜁ(Object A_0, EventArgs A_1)

By Trent L. Taylor - 6/18/2008

We actually traced and reproduced this the other day, so I know that the environment sees two BOs with the same name and namespace.  You may want to check your references, do a clean solution, etc. and go at it from that approach.  You may not have created a second instance, but your AppDomain and environment may see two references.  This can happen if you have residue out in your Bin folder (or some other folder in the path) and the reference sees a different BO instance that you are expected (i.e. a project reference).

If you use source control, make sure everything is checked in, delete your local work folder, then get everything back from source control.  Do a Clean Solution, then you may want to remove and re-add your references.  Then once you  make these changes, rebuild the solution (not just a build), get out of VS and come back in.  That is where I would start.

By Michael Reese - 6/18/2008

Well, I looked for the phantom BO and could not find it so I deleted the BO that already exist and created new one with a different name. Cleaned, rebuilt , uloaded/reloaded VS and then I got the dreaded message again. This time for the new BO???

Michael

By Greg McGuffey - 6/18/2008

Michael,



The phantom BO isn't likely in source... it is some how in your dev environment (i.e Visual Studio is messin' with ya). Don't look for the BO, you likely won't find it. Rather follow Trent's advise, make sure you are checked in to source control, then do a fresh check out (after deleting the existing) and then do a clean and rebuild (not a build). This has cleaned up a lot of these issues for me past.



Hope this helps.
By Michael Reese - 6/18/2008

Thanks Greg,

Think I got it fixed? However, I thought that I had it fixed before only to have dup show up again with the new BO w00t.

This is the gift that keeps on giving!!

By Michael Reese - 6/19/2008

Ok,

I have been through this project from top to bottom. Looked through VS and Microfour. The problem will go away then come right back somtimes after a cleaning or if I dump the datafiles in my bin\debug folder. Question, when I click the populate datasource settings button in a combobox, where is it looking for the business objects? This only happens with the combobox?

Hair on fire!Angry

By Trent L. Taylor - 6/19/2008

Question, when I click the populate datasource settings button in a combobox, where is it looking for the business objects?

We actually rely on the DTE to give us the references.  We search through the projects within the solution.  Then for each project, we query the references and search for classes that are a subclass (at some heirarchal point) of BusinessLayer.  I am willing to bet that you have a reference issue somewhere.  That would be my first inclinication.

I know how you feel in regards to this though...sometimes .NET can hang onto things and it may end up being a simple fix in the end, but there are not any messages to clue you in! Ermm