Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language

Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Asp.Net Programming

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

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?


Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc