Strangeness with BO and columns not defined in BO


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'm filling a BO using the FillDataTable method. The query that I'm using is actually hitting a view and of 9 columns I'm returning, only three have the same name as strongly typed properties in the BO.



The weirdness is that for certain column names, I get an exception:

IndexOutOfRangeException

The given item name could not be evaluated. The item 'VendorID' does not exist on the business object.

Source : MicroFour StrataFrame Business

Stack Trace:

at MicroFour.StrataFrame.Business.BusinessLayer.GetDescriptor(String FieldName)

at MicroFour.StrataFrame.Business.BusinessLayer.get_Item(String FieldName)

at MicroFour.StrataFrame.UI.Windows.Forms.ListView.CreateListViewItem(BusinessLayer BusinessObject)

at MicroFour.StrataFrame.UI.Windows.Forms.ListView.PopulateListView(Object[] Parameters)

at MicroFour.StrataFrame.UI.Windows.Forms.ListView.Requery(Object[] Parameters)

at FOXSystems.RAMS.UI.SearchEngine.SearchUIManager.Search(Object sender, EventArgs e) in E:\FoxSystems\RAMS\trunk\RAMS.NET\RamsUI\SearchEngine\SearchUIManager.vb:line 1430

at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)

at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)

....etc.





As you can see, this is occurring when a listview is attempting to load data from the BO and attempts to get the descriptor. Now, there will be no descriptor for VendorID, because it isn't one of the properties in the BO.



What is weird, as I mentioned, is that there are several other columns (more than half) that also don't have descriptors in the BO, but they are working fine. I would understand if none of them worked, but only some of them are failing (so far, those starting with "Vendor" have failed, though I doubt that that word is causing the problem).



I'm sure I'm doing something wrong, somehow, because I'm using this sort of thing all over the place to fill listview, combos and listboxes...and it works with other columns. What could I be missing here?



Thanks!
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Hmmm....that is really strange.  Like you said, this is something that you do a lot.  When loading a column in a ListView, we do not look for the strong-typed properties since you can, like you said, use a field that does not actually "belong" to the BO.

I would be curious to see this so I could run it through a debug.  You could do this on your side as well.  You could do one of two things:

  1. Get your application up to the point before it fails and then turn on the exceptions through the Debug menu to break on any exception so that you can see the line it is failing on, look at the call stack and see where it is breaking.
  2. Actually open up the ListView source code and place your break point in the Requery so that you can track it down.

If you could reproduce this in a sample then I would be more than happy to take a look at it also.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
How would I do #2? I've never used the SF source like this. Reference the sf project?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You can do this several ways.  You can open the source, select the UI project, right-click and go into Properties.  Oonce in there, go to the debug tab and set a program to execute your application EXE in the program to execute.  Make sure that the UI project is select, and hit the play button.

Second, be sure that the SF source is built in debug.  Then be sure that your application is built in debug.  Just run your application from the EXE (not through Visual Studio).  Then open the SF source and add your break point.  Next, click Debug->Attach to Process and select your EXE process that is running.  Thhe break point should then be hit once reached.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search