473,545 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 (DeleteissueQue ry) that
excpects an id
I get following error when clicking the delete button:
ObjectDataSourc e 'ObjectDataSour ce3' could not find a non-generic
method 'DeleteIssueQue ry' 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:
ObjectDataSourc e 'ObjectDataSour ce3' could not find a non-generic
method 'UpdateIssueQue ry' 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 2758
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 (DeleteissueQue ry) that
excpects an id
I get following error when clicking the delete button:
ObjectDataSourc e 'ObjectDataSour ce3' could not find a non-generic
method 'DeleteIssueQue ry' 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:
ObjectDataSourc e 'ObjectDataSour ce3' could not find a non-generic
method 'UpdateIssueQue ry' 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.goo glegroups.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 (DeleteissueQue ry) that
excpects an id
I get following error when clicking the delete button:
ObjectDataSourc e 'ObjectDataSour ce3' could not find a non-generic
method 'DeleteIssueQue ry' 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:
ObjectDataSourc e 'ObjectDataSour ce3' could not find a non-generic
method 'UpdateIssueQue ry' 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.goo glegroups.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 (DeleteissueQue ry) that
excpects an id
I get following error when clicking the delete button:
ObjectDataSourc e 'ObjectDataSour ce3' could not find a non-generic
method 'DeleteIssueQue ry' 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:
ObjectDataSourc e 'ObjectDataSour ce3' could not find a non-generic
method 'UpdateIssueQue ry' 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
6319
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 correctly but it is not updating or deleting the rows. What I did was, in design view, added a gridview control and added an sqldatasource...
2
6534
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 *that is going to be deleted* into another table, before the original data is deleted. I am trying to use the RowDeleting method to call an Update...
0
3548
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 OleDbParameterCollection" whenI try to write a new record. Delete and Modify work fine its just the add record function causes the error.
3
7317
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
1969
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 that every works really fine with this code when customers order approximatelly a maximum of 35 products. What I learned so far is to set the...
11
4055
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, CrtdUser and Date And Edit and Delete buttons
4
1791
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"> <EditItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton>...
2
2472
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 contact in our database. I also need to use the Edit and Delete funtions in the gridview. Neither seems to be working as intended.
5
3669
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). Now if I run the application and click the “Edit” Button then the complete row is generating the textboxes to edit the data in that particular row and...
0
7459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7653
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7411
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4942
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
695
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.