Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Serious limitation of ObjectDataSource + DataObjectTypeName + DataSet as BusinessEntity

Thread Tools

Serious limitation of ObjectDataSource + DataObjectTypeName + DataSet as BusinessEntity
Posts: n/a
Hi fellas,

has anyone managed to get ObjectDataSource to work Datasets where the
Dataset is used as BusinessEntity class?

What I mean is the following architecture:

1.WebPage with ObjectDataSource
2. CustomBusinessObject which
* does validation,
* uses a Strongly Typed DataTable as a collection of BusinessEntity
* forwards data access to DataAdapters as a data layer
3. DataLayer based on DataAdapters

Ideally I would like to use the DataObjectTypeName property of the
so that the methods of the CustomBusinessObject are with a single
parameter e.g.
Insert (Customer c);
The problem stems from the fact that the ObjectDataSouce requires the
BusinessEntity class (in this case this would be strongly typed data
row) should have a default constructor. Unfortunately, I could not
figure way of implementing a strongly typed data row with default

Is there any way around this situation?

The only solution I could come up with so far is to not set the
DataObjectTypeName and handle the ObjectDataSource's Inserting,
Updating and Deleting events ... but this still requires a fair amount
of trivial code.

It would have been great if there was a way to plug into the creation
of BusinessEntity instances instead of relying on default constructors



Reply With Quote
Posts: n/a
The ObjectDataSource isn't designed with extensibility in mind so you
have to adapt to it.

If you need more customization, you can use my ExtendedObjectDataSource
that has more features and comes with full source so you can modify
what you want:

Right now to create the object it uses
Activator.CreateInstance(dataObjectType) but you can change it to
whatever you need.


Reply With Quote

Thread Tools

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
ObjectDataSource, DataObjectTypeName and '...could not find a non-generic method ...' Kernel Bling ASP .Net 9 10-02-2007 02:28 PM
Could not find a property named '... ' on the type specified by the DataObjectTypeName property in ObjectDataSource '...' Anabela Silva ASP .Net 0 11-01-2006 07:08 PM
ObjectDataSource UpdateItem with DataObjectTypeName Original values required Martin ASP .Net 1 06-27-2006 11:00 AM
ObjectDataSource: UpdateParameters ignored when specifying DataObjectTypeName? Phillip Ian ASP .Net 1 04-28-2006 03:25 PM
Question about ObjectDataSource.DataObjectTypeName =?Utf-8?B?aGFwcHluaXUxOTg1?= ASP .Net 0 06-27-2005 05:48 PM