StrataFrame Forum

Business Object in Web Application

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

By Hugo R. Figueroa - 1/18/2007

I have a solution with 3 projects:

1)  winform application project

2) webform application project

3) business object project

I am making maintenance forms for projects 1 & 2 using the business objects in project 3.

everything is ok, but when trying to set the bindingfield for the textboxes in one webform I get this message:

"The selected business object name doeas not appear to be valid. The fields could not be enumerated"

I can select the business object by means of the BusinessObjectName Property and I used the same object succesfully in the winform counterpart, and certainly haven't had problems with other business objects.

I have deleted the business object, created and configured it again, built and rebuilt all the projects, have shutdown visual studio and the computer. but still the same.

Please somebody can tell me what can be wrong?

Thanks

By Guillermo Vilas - 1/18/2007

Did you added a reference to the BusinnesObject in the ApplicationBasePage under the App_Code Folder?
By Hugo R. Figueroa - 1/18/2007

yes, I did it.
By Hugo R. Figueroa - 1/18/2007

Thank you Guillermo

What I did wrong was to create  a second applicationbasepage (applicationbasepage2) and add the reference there.

Now I put the reference in the original applicationbasepage and  I can fill in the bindingfield property.

But, if I have a lot of business objects I can't put all them there.

I have to reread the help because I am missing something.

PS: Do you play tennis?BigGrin

By Hugo R. Figueroa - 1/18/2007

The help says:

Multiple ApplicationBasePage Classes

As a whole, a StrataFrame ASP.NET application may use hundreds of different business objects, while each page needs 10 or less. Rather than requiring you to declare of the business objects for the entire application on the same ApplicationBasePage, you can create separate ApplicationBasePage classes. The webforms within the application can then inherit from the ApplicationBasePage that contains only the business objects it needs.

But if I put the business objects references in another ApplicatioBasePage I get the error mentioned at the beginning of this topic.

By StrataFrame Team - 1/19/2007

When you placed the business objects in another base page class, did you change the inherits of your web form to reference the new base page, or does it still reference the original ApplicationBasePage?  You'll need to change the inherits to subclass the new ApplicationBasePage and build the project before the type editor will work.
By Hugo R. Figueroa - 1/19/2007

Yes , I did it.

A even shutdown visual studio and the computer, and rebuilt before and after that.

By Hugo R. Figueroa - 1/19/2007

Now I am getting this message when trying to build or rebuild the project:

Error 1 Invalid access to memory location. (Exception from HRESULT: 0x800703E6) D:\Visual Studio 2005\WebSites\reto\web.config 29 

Then, I created another web project and I am getting the same error.

Crazy

By StrataFrame Team - 1/19/2007

That's odd that you would be getting that error.  Is the error only occuring on a StrataFrame web site project, or any web site project?  When I Googled your error message, I found this site, http://www.xerratus.com/2006/03/24/AnnoyingInvalidAccessToMemoryLocationExceptionSolution.aspx, which says that this might be a problem with VS referencing the Microsoft.SqlServer DLLs, so you might try removing them from your references in the web.config file.
By Hugo R. Figueroa - 1/19/2007

I am only doing strataframe projects ( I'm coming from VFP and was reluctant to learn .net  until I discovered STRATAFRAME).

I've tried removing those Microsoft.SqlServer lines from web.config, but everytime I rebuild the project they appear again.

If I rebuild several times, sometimes the error doesn't show; but I still have the original problem ( I can select the business object from BusinessObjectName, but when trying to set the bindingfield property  I get the message :

"The selected business object name doeas not appear to be valid. The fields could not be enumerated"

By StrataFrame Team - 1/19/2007

Could you post the source code for your .aspx.vb and .aspx pages that are causing the problem as well as the code for your applicationbasepage2.vb file.  If this is a production site, or you are uncomfortable posting it here, then you can email it to me.  Thanks.
By Hugo R. Figueroa - 1/19/2007

I'm sending you an e-mail.

Thank you.

By Ben Hayat - 1/19/2007

Ben Chase (01/19/2007)
Could you post the source code for your .aspx.vb and .aspx pages that are causing the problem as well as the code for your applicationbasepage2.vb file. If this is a production site, or you are uncomfortable posting it here, then you can email it to me. Thanks.




Ben, you give great support! Cool
By Hugo R. Figueroa - 1/20/2007

I don't know if this can help, but if I add the business object to the ApplicationBasePage.cs too, and continue to reference the ApplicationBasePage2.cs , I get no error and I am able to select a field in BindingField property.
By Hugo R. Figueroa - 1/24/2007

I am stuck with this.
By StrataFrame Team - 1/24/2007

Thanks for sending the source code.  I was able to reproduce and fix the error that you received.  The fixes will be included in the next release here in the coming 2 or so weeks.  In the meantime, you can workaround the problem by leaving the definitions in your main ApplicationBasePage.cs file.  I would post the updated DLLs, but several other things have changed, and I don't want to cause you more headaches by sending you DLLs that will break what you're working on.
By Hugo R. Figueroa - 1/24/2007

Thank you.

I was pulling my hairs..Tongue

Now I can wait  and let them grow again   Smile

By Ivan George Borges - 1/24/2007

Hi Hugo.

Ask Ben for some of his. He's got plenty to share... BigGrin

By StrataFrame Team - 1/25/2007

Did I mention that I shaved my head last week?  It's not a pretty shaved head, but...

just kidding...

By Jason Stevenson - 2/12/2007

FYI.

A developer at my company also received this error while attempting to build a web project using strataframe objects:

Invalid access to memory location. (Exception from HRESULT: 0x800703E6) in web.config file in the following line:
<add assembly="Microsoft.SqlServer.Replication, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>

It was resolved by re-registering the following 2 dlls:

regsvr32.exe msxml3.xml
regsvr32.exe msxml6.xml

Good luck,

Jason Stevenson

By StrataFrame Team - 2/13/2007

Good to know, Jason.  Thanks for the tip.  Most of our web servers also have SQL Server installed on them, and MSXML 6 is a prerequisite for that, so that explains why we haven't run into this problem.