473,770 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ObjectDataSourc e Update method and StronglyTyped data tables

Hi,

I am truing to find a pattern for my Business Logic Layer to be able to work
fine win ObjectDataSourc e's Update method.
The challenge is ObjectDataSourc e 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 ObjectDataSourc e's update method?

Any help would be appreciated,
Max
Oct 23 '07 #1
1 5416
Hi Max,

Regarding on the ASP.NET ObjectDataSourc e 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 ObjectDataSourc e 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" <al*******@news group.nospam>
Subject: ObjectDataSourc e 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 ObjectDataSourc e's Update method.
The challenge is ObjectDataSourc e 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 ObjectDataSourc e's update method?

Any help would be appreciated,
Max
Oct 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
8705
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press update after making changes, but I don't want that update button. How can I get the updated object when the user presses one of my other action buttons?
5
1990
by: Ole M | last post by:
I'm having some trouble using the ObjectDataSource in ASP.NET 2.0. I have a wrapper that contains the static methods for Select and Update. The Update-method takes the business object as parameter. When the Update-method is invoked by the ObjectDataSource, the object referenced is not the same object returned by the Select-method, but a new object with only the values from the Edit-template. So basically I get a reference to a useless...
4
3423
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void RaiseCallbackEvent(string eventArgs) { // update the data object with the values currently on screen FormView1.UpdateItem(true); }
3
1879
by: mthomason | last post by:
I keep getting this error when trying to update records using an ObjectDataSource. I have seen others post similar errors...but I haven't found any solutions. ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateProduct' that has parameters: ProductName, UnitPrice, ProductId. I have been unable to work through this. Any ideas? I’m using code pasted directly from this page:
1
3064
by: Felix_WafyTech | last post by:
Hi, I'm working with the ObjectDatasource and the application is getting more and more chatty. Is there a way I could make the ObjectDatasource support multiple DataTables that could be retrieved as one Dataset? I'm wondering how others out there work with ObjectDatasource? The only option I now see to get this fixed is to manually make the call to the Web services, retrieve the Dataset and assign the datatable to the controls (Or can...
0
1463
by: Phil | last post by:
Environment: XP sp2 VS.Net 2005 (Asp.Net 2.0 - c#) Sql Server 2005 Scenario: -Table (Table1) with two columns: Table1Id <- Primary Key Column1
1
2782
by: Scott F K Hooper | last post by:
My ASP.NET 2.0 project has a GridView that I want to be able to edit and update records with. The GridView has been bound to an ObjectDataSource control that has the following Update method signature: Update(Nullable<Int32> Tile_Number, String Tile_Name, String Tile_Path, Nullable<Decimal> Value, Boolean Sold, Boolean Payment_Verified, Nullable<Byte> Owner_Type, String Line_1, String Line_2, String First_Name, String Last_Name, String...
1
1706
by: =?Utf-8?B?cm9zczYxMw==?= | last post by:
I really hope this is not a case of "this silly thing will never work".....lots of time invested in troubleshooting this already. I have created a standard ASP.NET web form (.aspx) with several collections of textboxes prompting for entry into a fairly monolithic database. I decided to create a business object (called Employee) and use the ObjectDataSource to broker data being transmitted between the UI and my Employee object (and...
0
1652
by: =?Utf-8?B?RGVuaXMgU29oZXQ=?= | last post by:
Hi all, I've created a new project to test ObjectDataSource component. I've just added a new objectdatasource, configured it (linked to a table) etc ... It works fine on localhost, i can create, retrieve, update and delete data.
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.