473,394 Members | 1,755 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,394 software developers and data experts.

FormView, ObjectDataSource, Business object: can't customize some methods

Hello folks, I'll try to be as much clear as I can.

This is my issue: Asp.NET 2.0 page w/ FormView (later: FW), an
ObjectDataSource (ODS). It works with my Business logic layer, where I
have some methods to retrieve and set data. ODS works with this
MyObjectManager object. MyObjectManager has GetObjects that return an
ObjectsCollection and so on. Nothing special.

MyObject has 3 properties, for example: Color, Description, Size
(datatypes are ininfluents)

Additionally and obviously, MyObjectManager has to save data. Let's
talk about adding, updating doesn't matter for the moment. Building
the add method as

MyObjectManager.AddObject(o as MyObject)

works well. I don't really know why (not yet done my homeworks), but
it seems that ODS recognize the type of objects I bound and passes a
filled o as MyObject to the function; o is correctly filled with data
I type in my FV.

Note: at this stage, looking at aspx code, ODS hasn't any
InsertParameters specified. Even if the method specified in
InsertMethod needs an "o" parameter.

Good but not enough: I want to extend my MyObjectManager.AddObject to
accept an incoming Username string, to log something. Method becomes:

MyObjectManager.AddObject(o as MyObject, Username as String)

Of course, I build and update my ODS to the new signature. In the aspx
code something appears under IsertParameters: now there are 2
insertparameters, for the "o" and for the "username" AddObject's
parameters.

But when I run this, fill the FV data and push "Insert", it crashes,
saying that ObjectDataSource can't find a non-generic method that
accepts the parameters

o, Username, Color, Description, Size

Seems like it "sees" parameters within InsertParameters but also
queues the fields it founds bounded to the FV. Above all, seems that
it no longer recognize the fact that it has to pass a MyObject
instance. I can always pass not a custom object to my managers but a
list of parameters, but that would be a great thing with objects wit
lot of properties.

Any suggestion?

TIA,
teKa

Jun 6 '07 #1
0 1309

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...
10
by: J055 | last post by:
Hi I've been trying out SqlCacheDependency using the ObjectDataSource and SQL Server 2005. It all works quite well with the minimum of configuration, e.g. <asp:ObjectDataSource...
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...
6
by: Chris | last post by:
I want do my insert to a database using a formview bound to an objectdatasource. I also want to upload a file. I'm quite new to and this is just test code but Is there any way I can pass the file...
5
by: =?Utf-8?B?QWRhciBXZXNsZXk=?= | last post by:
Hi All, I have a GridView inside the EditItemTemplate of a FormView. Both FormView and GridView are data bound using an ObjectDataSource. When the FormView's ObjectDataSource object has a...
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...
1
by: Bresco | last post by:
I'm using ObjectDatasource in combination with a Formview. The ObjectDatasource is connected to a FormView. I have a business object property which I can't update through the normal binding...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.