Value of CslaDataPortalUrl not being returned

Value of CslaDataPortalUrl not being returned

Old forum URL: forums.lhotka.net/forums/t/2264.aspx


Optimist posted on Friday, February 02, 2007

Hi,

As a very new recruit to CSLA, are there any issues with configuring CSLA 2.1 for Remoting on a single development PC? i.e. can I have the server-side DataPortal on the same PC as the client, but NOT configured as Local. I don't have a Server to hand, but I have to initially confirm that remoting will work.

I have already made sure that ASP.Net is working and checked the remoting configuration, but for some reason am unable to return the value of my CslaDataPortalUrl. The value DataPortalProxy is however returned ok.

Any thoughts from anyone!

skagen00 replied on Friday, February 02, 2007

Hi Optimist, welcome to the community.

Yes, no problem with having one PC serve as both the client and server. The idea of the remote dataportal is simply to have some location to act as one's server, and that location can be anywhere - including on the client PC.

I'm not entirely sure what you're meaning with your second paragraph, though.

Optimist replied on Friday, February 02, 2007

Hi Skagen00,

Thanks for responding. Re second paragraph:

I've been trying to work out why I've got an unhandled DataPortalException ("DataPortal.Fetch failed (System.NullReferenceException: Object reference not set to an instance of an object.) and thought the cause had to do with creation of an instance of a client-side proxy for the server object. This may not be the reason.

The exeception is generated right after 'Return Portal.Fetch(objectType, criteria, context)' but the parameter values seem good to me.

I'm currently at a loss, 'cos ASP.Net is ok, the remoting configuration seems ok and I'm looking again at my config files, however:

How does one check that my virtual root is an IIS application?

Thanks again

RockfordLhotka replied on Friday, February 02, 2007

It sounds like the exception originates within your code in DataPortal_Fetch(). Odds are that your db connection string or some other database object isn't getting created as you expect.

I always recommend doing initial debugging with a local data portal, so you can put breakpoints in your DP_Fetch() method and walk through it in the debugger.

You can also to a ToString() on the exception object to get the full stack trace. That sometimes offers insight into where the issue occurs.

Optimist replied on Saturday, February 03, 2007

RockfordLhotka:

It sounds like the exception originates within your code in DataPortal_Fetch(). Odds are that your db connection string or some other database object isn't getting created as you expect.

Rocky,

I'm amazed you found time to give me some advice, and it really helped. I failed to look at the obvious first and when I did, found a small mismatch in the connection string key name and resolved my issue.

Bought your ebook yesterday and looking forward to getting into it.

Best regards and thanks

Copyright (c) Marimer LLC