Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ObjectDataSource Update method and StronglyTyped data tables

Reply
Thread Tools

ObjectDataSource Update method and StronglyTyped data tables

 
 
Max2006
Guest
Posts: n/a
 
      10-23-2007
Hi,

I am truing to find a pattern for my Business Logic Layer to be able to work
fine win ObjectDataSource's Update method.


The challenge is ObjectDataSource is not able to work with an update method
that accepts a strongly typed data table as parameters. We have to have an
update method with all data table's columns as its parameter. Like what we
have here: http://asp.net/learn/data-access/tutorial-16-cs.aspx

I am trying to avoid listing all columns as Update method's parameters. Is
there any way to use the actual strongly type data table as the parameter
for ObjectDataSource's update method?

Any help would be appreciated,
Max


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      10-25-2007
Hi Max,

Regarding on the ASP.NET ObjectDataSource and the update method, it will
always require the following parameters pattern:

** a parameter list which represent all the necessary fields of a data
record(or a custom object)

** a custom class instance(whose properties can be mapping to database
record fields)

This reason why ObjectDataSource limit this is that DataSource control is
designed to work together with those complex databound controls, and for
those controls(such as GridView, DataGrid, DataList), its updating model is
one-record(row) per updating time(not batch updating). If you use DataTable
as parameter, that means you want to do batch update which doesn't match
those template databound control's update model. For such scenario, I
think it would be more flexible that you write the udpating code logic your
self so as to batch update multiple records.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Max2006" <(E-Mail Removed)>
>Subject: ObjectDataSource Update method and StronglyTyped data tables
>Date: Tue, 23 Oct 2007 18:09:08 -0400


>
>Hi,
>
>I am truing to find a pattern for my Business Logic Layer to be able to

work
>fine win ObjectDataSource's Update method.
>
>
>The challenge is ObjectDataSource is not able to work with an update

method
>that accepts a strongly typed data table as parameters. We have to have an
>update method with all data table's columns as its parameter. Like what we
>have here: http://asp.net/learn/data-access/tutorial-16-cs.aspx
>
>I am trying to avoid listing all columns as Update method's parameters. Is
>there any way to use the actual strongly type data table as the parameter
>for ObjectDataSource's update method?
>
>Any help would be appreciated,
>Max
>
>
>


 
Reply With Quote
 
 
 
Reply

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
Formview and ObjectDataSource Update method Aamir Ghanchi ASP .Net 3 02-05-2008 01:57 PM
StronglyTyped DataSets in ASP.NET 2.0 S.Tedeschi ASP .Net 2 06-07-2007 08:50 AM
ObjectDataSource & FormView adding two extra paramaters to Update method giving error non-generic method ... Fred Dag ASP .Net 0 09-18-2006 10:36 PM
ObjectDataSource method as another ObjectDataSource David Thielen ASP .Net Web Controls 3 03-23-2006 01:50 AM
ObjectDatasource - Does it support multiple data tables? Felix_WafyTech ASP .Net 1 02-28-2006 11:31 AM



Advertisments