Strangeness with BO and columns not defined in BO
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Strangeness with BO and columns not defined...Expand / Collapse
Author
Message
Posted 03/27/2008 6:25:06 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 7:28:28 PM
Posts: 1,148, Visits: 2,830
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!
Post #15218
Posted 03/27/2008 7:54:44 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 8:47:41 AM
Posts: 4,104, Visits: 4,175
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.

Post #15221
Posted 03/27/2008 8:22:07 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Yesterday @ 7:28:28 PM
Posts: 1,148, Visits: 2,830
How would I do #2? I've never used the SF source like this. Reference the sf project?
Post #15222
Posted 03/28/2008 8:06:27 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 8:47:41 AM
Posts: 4,104, Visits: 4,175
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.

Post #15227
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 10:10am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.