473,396 Members | 2,011 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,396 software developers and data experts.

gridview delete and update

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

Aug 30 '06 #1
3 2743
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?

ta******@gmail.com wrote:
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
Aug 30 '06 #2
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!
*************************************************
<ta******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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

Aug 30 '06 #3
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:
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!
*************************************************
<ta******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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
Aug 30 '06 #4

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

Similar topics

3
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
2
by: Robert Smith jr. | last post by:
Hello, Please pardon my newbie question ... I am building an ASP.NET page that displays a recordset with a Delete statement enabled (this all works fine). I want to Insert the current row...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
3
by: pvong | last post by:
VB.NET How do you change a gridview from Update mode to normal mode? I'm usually dealing for Formviews and there is a ChangeMode option but I don't see one for Gridviews.
0
by: KeesH | last post by:
Hi, I am quite desperate now because I made a nice webshop with a gridview where the customer is able to update the amount of products (Hostas in my situation) or delete the row. The problem is...
11
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
4
by: Jonathan Wood | last post by:
Greetings, I have a GridView control. For a couple of reasons, I ended up with a TemplateField to contain my Edit and Delete links, something like this: <asp:TemplateField ShowHeader="False">...
2
by: Danielle | last post by:
Hello all - Thank you in advance for any help you are able to provide. I am populating a gridview from a stored procuedure. The returned data is a name, phone number, email and guid of a...
5
by: sandhyascs | last post by:
Hi everyone I’m using the GridView in asp.net and populating the grid dynamically using c#.net.To edit the rows i i m using GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.