473,503 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overriding methods on an interface

So, I have an interface with several overriding methods:

using System;
using System.Collections.Specialized;

namespace some.name.space
{
public interface IVrsPersistenceProvider
{
string[] Select(string idName, string tableName, string whereClause);
string[] Select(string idName, string tableName, NameValueCollection
whereClause);
NameValueCollection Select(string[] selectColumns, string tableName,
long id, string idName);
NameValueCollection Select(string[] selectColumns, string tableName,
string id, string idName);
void Update(string tableName, NameValueCollection updateCollection,
long id, string idName);
void Update(string tableName, NameValueCollection updateCollection,
string id, string idName);
string Insert(string tableName, NameValueCollection
insertCollection);
void Delete(long id, string idName, string tableName);
void Delete(string id, string idName, string tableName);
}
}

This interface is referenced by another project (lets call it project
A) that uses a factory to obtain a handler to an instance of the above
interface.

I can compile the proj that contains the interface. I can compile the
project that contains implementors of the interface. However, when I
attempt to compile "project A" the compiler complains with the
following errors:

The best overloaded method match for
'some.name.space.IVrsPersistenceProvider.Delete(lo ng, string, string)'
has some invalid arguments

The best overloaded method match for
'some.name.space.IVrsPersistenceProvider.Select(st ring[], string, long,
string)' has some invalid arguments

The best overloaded method match for
'some.name.space.IVrsPersistenceProvider.Update(st ring,
System.Collections.Specialized.NameValueCollection , long, string)' has
some invalid arguments

If I change the method name it works...no mystry there. If I add an
extra arguement it works. What am I doing wrong?

Nov 16 '05 #1
2 2007
<by**********@hotmail.com> a écrit dans le message de news:
11**********************@z14g2000cwz.googlegroups. com...
I can compile the proj that contains the interface. I can compile the
project that contains implementors of the interface. However, when I
attempt to compile "project A" the compiler complains with the
following errors:

The best overloaded method match for
'some.name.space.IVrsPersistenceProvider.Delete(lo ng, string, string)'
has some invalid arguments

The best overloaded method match for
'some.name.space.IVrsPersistenceProvider.Select(st ring[], string, long,
string)' has some invalid arguments

The best overloaded method match for
'some.name.space.IVrsPersistenceProvider.Update(st ring,
System.Collections.Specialized.NameValueCollection , long, string)' has
some invalid arguments


AFAIK, this is caused by the calling code being incorrect, you don't appear
to show us that.

Joanna

--
Joanna Carter
Consultant Software Engineer
Nov 16 '05 #2
Actually, I restarted VS, and guess what?, It compiled.

I hate VS.NET.

Nov 16 '05 #3

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

Similar topics

8
6097
by: Corey Lubin | last post by:
someGlobal=1 class Original: def foo(self): # Make use of someGlobal from original import * someGlobal=2
1
1585
by: Burkhard Perkens-Golomb | last post by:
Hi, I've a question about XML documentation of overridding methods and methods implementing an interface declaration: These methods are normally documented in the base class or interface. So I...
17
2897
by: Bob Weiner | last post by:
What is the purpose of hiding intead of overriding a method? I have googled the question but haven't found anything that makes any sense of it. In the code below, the only difference is that...
4
5935
by: Phill. W | last post by:
Here's a knotty little problem. I have some nasty little controls that needs to behave in a non- windows-Standard way - don't ask why; it's a large application being converted from some older...
2
1987
by: =?Utf-8?B?d2R1ZGVr?= | last post by:
I know that I can't declare a method in an interface as virtual and override it, when I am using an explicit interface, but I am wondering if anyone else has come across this problem and how they...
10
6906
by: Sebastian | last post by:
Hi, I'm confronted with a problem that seems not to be solvable. In general: How can I override an interface member of my base class and call the overridden method from my derived class? This...
10
104978
by: r035198x | last post by:
The Object class has five non final methods namely equals, hashCode, toString, clone, and finalize. These were designed to be overridden according to specific general contracts. Other classes that...
17
1670
by: Donn Ingle | last post by:
Hi, Here's a framework for the questions: --- In a module, part of an API --- class Basis ( object ): def foo ( self, arg ): pass --- In user's own code --- class Child ( Basis ):
12
1524
by: danil52 | last post by:
Hello there, I have the following code: class Base { public: virtual void f() {cout << "Base::f()" << endl;} virtual void f(int) {cout << "Base::f(int)" << endl;} };
0
7202
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,...
1
6991
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
7462
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...
0
5578
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,...
0
4673
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
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
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 ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
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.