Databinding problems with ObjectDataSource

R

Richard Carpenter

I am working on a small project in which I am trying to implement a
data access layer through the use of a project dataset schema. Data
integrity and normalization will be handled through the use of SQL
Server stored procedures. Basically, for each data entity, I've written
_Get(), _Delete(), _Add() and _Update() stored procedures. The _Get()
procs return all data needed to display the information in a meaningful
manner to the user (description values are pulled in for foreign keys,
first/last names are concatenated, etc.). My _Add() and _Update() procs
just take the parameters necessary to create new and update existing
rows respectively, and the _Delete() proc just takes a key value for
performing the delete operation.

For my _Update() proc, I also included the @Original_ counterparts for
each parameter so that concurrency can be checked using ASP.Net's
CompareAllValues functionality. Furthermore, all procs are designed to
receive the @Original_ version of the key value where a key is needed.
This was actually done merely to try and remain consistent with the
auto-generated code and in the interest of avoiding any pitfalls
involved in handling any differences that might arise.

What is happening now is that when I drag a gridview control onto a new
webform, configure a new objectdatasource to use my custom procedures
and run the webform, everything displays wonderfully. However, when I
click the Edit linkbutton and make a change, upon clicking Update, I am
presented with an error to the effect of, "ObjectDataSource
'ObjectDataSource1' could not find a non-generic method Proc_Update()
that has parameters: .....". I checked the parameter list it mentions
and everything looks ok, except there is a parameter at the end that
isn't involved with my _Update() proc at all. It is, in fact, one of
the description values pulled in for a foreign key column in the _Get()
proc. I can't seem to figure out why it is being included in the
_Update() call, as it is not listed in the Update Parameters section of
the data source definition. I'm at my wits' end with this one. I have
tried creating a brand new webform with the same results. I've even
deleted the table adapter from my project's dataset and completely
recreating it with no luck.

On a somewhat related note, when I was configuring my table adapter
within the dataset designer, I specified my own stored procedures to
use for Get, Insert, Update and Delete actions, and for each one
(except for Get, of course) I specified that they would execute a
stored procedure and not return a value, which, strangely enough, looks
like that means it will return an integer reflecting the number of rows
affected. I tried setting them up to return a value, planning to
implement some error handling, but it looked like it was set to return
an object when I did so. Either way, I'm not sure which is the best way
to go with that setting, whether to support error handling or merely to
even get it working on a more basic level.

Any help with this would be *greatly* appreciated.

Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top