gridview delete and update

T

tarscher

Hi all,

I have a grid that contains 7 columns from 3 tables (3 unique keys, 4
normal fields). I show this 7 columns on the gridview. I now want to
add edit and delete functionality. This should be fairly easy cos it's
a build in feature of the gridview but alas...

When the user clicks delete only one row on one table needs to be
deleted thus I made a new query in my Datatable (DeleteissueQuery) that
excpects an id
I get following error when clicking the delete button:
ObjectDataSource 'ObjectDataSource3' could not find a non-generic
method 'DeleteIssueQuery' that has parameters: origin_id, original_id.

The same goes for the update: I only have to update one table and have
created a query that expects 5 parameters:
ObjectDataSource 'ObjectDataSource3' could not find a non-generic
method 'UpdateIssueQuery' that has parameters: issue, description,
idbuild, idhardware, origin_id, hardware, build, original_id.

It looks like the gridview is sending parameters to the queries that
should not be passed. How can i control what parameter is send and what
isn't?

Thanks in advance

Stijn
 
C

Cowboy \(Gregory A. Beamer\)

Without seeing the code, I am a bit in the dark.

The norm is to link a GridView to some data source. If this is done
declaratively (in the tags using the property dialogs), you create the
commands in the datasource. When you use the declarative method, you simply
make sure each command is represented and add the proper buttons.

If you are using code, you have to create an event for the functionality you
are attempting to create. The way to do this is click on the gridView in
design mode and then go to events and add. if you prefer typing, add the
proper signature to a subroutine and use Handles (VB.NET) or add the event
handler to your routine (C#).

Based on your issue, it sounds like you do not have a proper delete command
in the datasource (and you are using declarative binding).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 
K

KJ

When you configured the ODS using the smart tag, did it properly
recognize the parameters for your update method? What did you assign
them to?
 
T

tarscher

You're right and solved it. The gridview was sendin origing_id but the
query expected orinal_id's. Changing it made it work.

Thanks

Cowboy (Gregory A. Beamer) schreef:
 

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

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top