PC Review


Reply
Thread Tools Rate Thread

databinding error - business layer props to my webcontrol

 
 
=?Utf-8?B?bWdvbnphbGVzMw==?=
Guest
Posts: n/a
 
      13th Feb 2006
I create a business layer object w/public properties. the db access is also
done from here. Its here I set the property values as well.

So when my UI request is made all values are saved to the viewstate and
loaded. Then I want to bind my object to a webcontrol:

myDatagrid.Datasource = myBusinessObj;
myDatagrid.Databind();

This is where my error occurs. Some error regarding IEnumerable and
IEnumerator.

any ideas? thanks.




 
Reply With Quote
 
 
 
 
Frans Bouma [C# MVP]
Guest
Posts: n/a
 
      14th Feb 2006
mgonzales3 wrote:

> I create a business layer object w/public properties. the db access
> is also done from here. Its here I set the property values as well.
>
> So when my UI request is made all values are saved to the viewstate
> and loaded. Then I want to bind my object to a webcontrol:
>
> myDatagrid.Datasource = myBusinessObj;
> myDatagrid.Databind();
>
> This is where my error occurs. Some error regarding IEnumerable and
> IEnumerator.


The binding you want to perform is called 'complex' binding, which
means that an IListSource or IEnumerable object, containing other
objects, is bound to a grid/list like control. So binding a single
object to a grid isn't possible. Store your business object in an
arraylist and bind that to the grid.

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Databinding of complex business layer classes Dirk Microsoft Dot NET 8 27th Jan 2007 09:28 PM
business layer, data access layer , presentation layer for asp.net using C#.net Dhananjay Microsoft VB .NET 6 20th Dec 2006 02:16 AM
business layer, data access layer , presentation layer for asp.net using C#.net Dhananjay Microsoft C# .NET 2 19th Dec 2006 09:23 AM
business layer, data access layer , presentation layer for asp.net using C#.net Dhananjay Microsoft ASP .NET 1 18th Dec 2006 11:35 PM
Link form DataSet to business layer DataSet, whilst maintaining design-time databinding support muesliflakes Microsoft C# .NET 2 5th Feb 2004 03:59 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:06 PM.