473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Formview and ObjectDataSource Update method

Hi,

Why does the Update method of an ObjectDataSource class requires
parameters for each of the Bind input controls of a FormView?

I have a class (say MyObjectDataSource) that is being used as an
ObjectDataSource for a FormView control. MyObjectDataSource has public
properties that correspond to db table columns and are also used to <
%# Bind("")%Input controls in the formview declaratively.
There is an Update method in MyObjectDataSource that requires a
parameter for each and every Bind server controls. Otherwise I get a
server error that reads something like this

ObjectDataSource 'MyObjectDataSource' could not find a non-generic
method 'MyUpdateMethod' that has parameters: param1, pram2 and on and
on till it lists all the public properties to which the server
controls are bind.

I thought It was a given that the Update method should inherently know
about the Bind controls as they are bind to the public properties in
the same class of which the Update method is part of.

Am I doing something wrong or is there a need for design improvement
in Asp .Net in this regard.

thanks!
Jan 7 '08 #1
2 2611
On 7 Jan, 18:36, Aamir Ghanchi <aamirghan...@gmail.comwrote:
Hi,

Why does the Update method of an ObjectDataSource class requires
parameters for each of the Bind input controls of a FormView?

I have a class (say MyObjectDataSource) that is being used as an
ObjectDataSource for a FormView control. MyObjectDataSource has public
properties that correspond to db table columns and are also used to <
%# Bind("")%Input controls in the formview declaratively.
There is an Update method in MyObjectDataSource that requires a
parameter for each and every Bind server controls. Otherwise *I get a
server error that reads something like this

ObjectDataSource 'MyObjectDataSource' could not find a non-generic
method 'MyUpdateMethod' that has parameters: param1, pram2 and on and
on till it lists all the public properties to which the server
controls are bind.

I thought It was a given that the Update method should inherently know
about the Bind controls as they are bind to the public properties in
the same class of which the Update method is part of.

Am I doing something wrong or is there a need for design improvement
in Asp .Net in this regard.

thanks!
Hi

Does the data row being updated have a unique key, and if so is it
named in the DataKeyNames property of the Formview?
Jan 7 '08 #2
Hi Phil,

Yes it is a unique key and is in the DataKeyNames property of the
Formview.

Thanks.

On Jan 7, 12:51*pm, Phil H <goo...@philphall.me.ukwrote:
On 7 Jan, 18:36, Aamir Ghanchi <aamirghan...@gmail.comwrote:


Hi,
Why does the Update method of an ObjectDataSource class requires
parameters for each of the Bind input controls of a FormView?
I have a class (say MyObjectDataSource) that is being used as an
ObjectDataSource for a FormView control. MyObjectDataSource has public
properties that correspond to db table columns and are also used to <
%# Bind("")%Input controls in the formview declaratively.
There is an Update method in MyObjectDataSource that requires a
parameter for each and every Bind server controls. Otherwise *I get a
server error that reads something like this
ObjectDataSource 'MyObjectDataSource' could not find a non-generic
method 'MyUpdateMethod' that has parameters: param1, pram2 and on and
on till it lists all the public properties to which the server
controls are bind.
I thought It was a given that the Update method should inherently know
about the Bind controls as they are bind to the public properties in
the same class of which the Update method is part of.
Am I doing something wrong or is there a need for design improvement
in Asp .Net in this regard.
thanks!

Hi

Does the data row being updated have a unique key, and if so is it
named in the DataKeyNames property of the Formview?- Hide quoted text -

- Show quoted text -
Jan 7 '08 #3

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

Similar topics

5
by: Jurgen Appelo | last post by:
I'm at a loss here... My FormView control automatically performs a databind at each postback on the server. But in some cases I don't want this to happen. Like when the business layer decides that...
3
by: Jurgen Appelo | last post by:
I asked this question earlier, but unfortunately the two replies I got did not solve the problem. Here it is again, but now with the code: After an Update my FormView always loses its viewstate...
0
by: ThePurpleCat | last post by:
Hi, I'm a newbie to ASP.NET programming but not to Visual Studio. I'm having trouble getting my Master-Details page to work. I have a page enabled GridView which is linked to a FormView control...
0
by: sanjeev06 | last post by:
When Updating using a FormView and ObjectDataSource, the formview always does the data-binding of its controls and the field values in the FormView are always overwritten by the results of the...
1
by: Pao | last post by:
I have a formview bounded to an objectdatasource. All ok but I have some trouble with a checkbox: when I am in update mode and I update the record, this field is never updated (no errors thrown)....
0
by: andy | last post by:
I have an object. Theres a get, update, insert (etc) method for this The Get rturns an IList which I bind to a formview via objectdatasource. In the get method I store the object in session...
0
by: =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?= | last post by:
Hello, I read some msdn and other articles about how does databinding among DataSource controls and FormView / GridView controls works but I still don't fully understand to this blackbox. I have...
8
by: =?Utf-8?B?QXNo?= | last post by:
Hi, I have an object, for example User. User contains various properties which i have been able to bind to successfully using wizards and the form view. However if the class User has a property...
3
by: KaOne | last post by:
Hi All, excuse me in advance for my not very perfect english. I need some help about a problem with a FormView bounded to an ObjectDataSource. In practise I have an ObjectDataSource that uses some...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.