473,473 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

could not find a non-generic method

I have an ObjectDataSource binding a GridView, with Delete enabled. The
following is the declaration (with non-delete stuff left out to save space):

<asp:ObjectDataSource ID="CatalogItemsListDataSource"
runat="server" DeleteMethod="DeleteCatalogItem"
InsertMethod="InsertCatalogItem"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetCatalogItemsList"
TypeName="CatalogItemManager" UpdateMethod="UpdateCatalogItem">
<DeleteParameters>
<asp:Parameter Name="id" Type="Int32" />
</DeleteParameters>
....
</asp:ObjectDataSource>

So I've got a class that has the following function:
[DataObjectMethodAttribute
(DataObjectMethodType.Delete, false)]
public int DeleteCatalogItem(int id)
{
return CatalogAdapter.DeleteItemQuery(id);
}

when it runs, it gives me the following error:
[InvalidOperationException: ObjectDataSource 'CatalogItemsListDataSource'
could not find a non-generic method 'DeleteCatalogItem' that has parameters:
id, original_Id.]

which seems odd, because I selected the delete method above with a single
parameter during the ObjectDataSource configuration wizard.

So I created another method with two parameters that works:

[DataObjectMethodAttribute
(DataObjectMethodType.Delete, false)]
public int DeleteCatalogItem(int id, int original_Id)
{
return DeleteCatalogItem(original_Id);
}

Which is fine, but I'm curious why it expects two parameters when I selected
the method that has one (and the DeleteParameters shows that I only wanted
one paramter).

Thanks

Jul 19 '07 #1
0 1486

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

Similar topics

12
by: Ryan Paul | last post by:
I've spent a lot of time using python, and personally, I feel like it is vastly superior when compared to languages like java, and c++, but there are still a few things that detract from its...
10
by: Steven T. Hatton | last post by:
Stroustrup says this: http://www.research.att.com/~bs/bs_faq2.html#macro "So, what's wrong with using macros?" "And yes, I do know that there are things known as macros that doesn't...
4
by: simduss | last post by:
Hi, First of all, I'm a beginner with Unix. I have a "make" (Unix command) problem with a Pro*C sub-program since I installed Oracle8i (before I was at 7.3.4). I have a script builder that...
1
by: JP Lacasse | last post by:
I translate a web application from ASP to ASP.NET and I keep getting the following error: Could not find installable ISA I used the same ConnectString ("DBQ=" &...
2
by: semedao | last post by:
Hi All, I developed Outlook add-in with VS 2005 , everything work fine , until the machine reboot unnormally , when I opened the solution again many projects was not there ! (I have more then...
4
by: Rollasoc | last post by:
Hi, We have a range of four products that can talk to our software (Written in C# & managed C++) via ethernet. Using standard socket class. This has all been working fine for a long time now,...
3
by: Amritha.Datta | last post by:
Can anyone tell me why the below code returns error? Exception Details: System.IO.FileNotFoundException: Could not find file Dim strLFolder As String = "c:\Temp\F Files" Dim intClientID As...
18
by: Neehar | last post by:
Hello For one of the interviews I took recently, I was given an offline programming quiz. In 30 minutes I had to write code in C++ to counts the number of times each unique word appears in a...
3
by: Lance Wynn | last post by:
Hello, I am receiving this error when trying to instantiate a webservice component. I have 2 development machines, both are XP sp2 with VS 2008 installed. On one machine, the code works fine. On...
12
by: webinfinite | last post by:
#define D(y...) (const int ) {y} My understand is that D is taking in a various length parameter y which is an array of const int. Am I right? Thanks.
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
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...

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.