Which object is null when you use your debugger and step through the code:

Is it LoadType, dataItem or LblLoadType?

John Davidson

On Tue, Mar 30, 2010 at 4:33 PM, Ashwin <[email protected]> wrote:

> Hello ,
>
> I am new to nhibernate and am trying to get a collection of objects
> from my database.
>
> Here is what Iam trying to do ..
>
> I have a table called load and it has a foreign key to another table
> called LoadType.
>
> Now in the mapping load.hbm.xml table here is what I have in place.
>
>    <many-to-one name="LoadType"   cascade="save-update"
> column="`LoadtypeId`"></many-to-one>
>
> Now when I get the collection and try and access the description
> property in the LoadType table
>
> LblLoadType.Text = dataItem.LoadType.Description;
>
> I get the error  " Object reference not set to an instance of an
> object. "
>
> I tried with the lazy option being
>
> Lazy = false
> Lazy = proxy
> Lazy = no-proxy
>
> But I still get the same error.
>
> Can some one help me please. ?
>
> Thanks in advance.
> Ashwin
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to