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

Implements and interface in c#....pls help

Can someone pls give some comments about the following codes of interface and implements ?
2 files, ITrans.cs and DDDBIQ.cs (is part of the whole solution)

In file ITrans.cs,
namespace Trans
{
public interface ITrans
{
string DoTrans(string strXML);
}
}
In file DDDBIQ.cs,
using CDBUtil;
namespace Trans
{
public class DDDBIQ : ITrans
{
static string DoTrans(string strXML)
{
Log.WriteLine(strXML, "DoTrans");
return "<XML><ValidCode>Axis</ValidCode><STATUS>00</STATUS></XML>";
}
}
}

When I build the solution, I have the following error.

C:\Inetpub\wwwroot\CDBWebService\Trans\DDDBIQ.cs(5 ): 'Trans.DDDBIQ' does not implement interface member 'Trans.ITrans.DoTrans(string)'. 'Trans.DDDBIQ.DoTrans(string)' is either static, not public, or has the wrong return type.
How to reslove this? Thanks.
Nov 16 '05 #1
1 1481

Hi
This is because you are implementing the interface function as static which
is not allowed. What happen is that the compiler expect you are creating a
new function and that you didn't implement the function of the interface ,
so it tells you that you need to do so . If you explicitly specify that
you mean the interface function by saying
static string ITrans.DoTrans(string strXML)
then it will tell you the real reason behind the error you are encountering
( the modifier static is not valid for this item). Hope that help.
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2

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

Similar topics

3
by: Jeff Molby | last post by:
Ok, I've googled long and hard, but I can't find anything relevant on this one. I am now at the mercy of your good nature. <g> I have 3 projects in my solution: One app and 2 libraries. I am...
2
by: Todd Brooks | last post by:
I have a coclass that implements a dual interface. The thing that's a little unusual is that the coclass doesn't inherit directly from the interface, rather it inherits from an implementation class...
5
by: Joe Rattz | last post by:
Ok, I am trying to figure out how to tell if a class (not object) implements a particular interface. Using the "is" operator does not seem to work for me and I assume its because I have a class,...
6
by: Klaus Löffelmann | last post by:
Hello, why is it necessary to implement every procedure of an interface by assigning it manually with another "implements" to the corresponding procedure of the class, which actually...
0
by: ns2k | last post by:
I tried to implements Microsoft.Office.Core.Range Interface, but the dot net raise errors : + ' '_Default' cannot implement '_Default' because there is no matching property on interface 'Range'.'...
3
by: topdawg147 | last post by:
Is there any way to retrieve a list of objects that implement an interface. For example, suppose we have the following: Public Interface ISomething Function SomeFunction() As String End...
3
by: Michael | last post by:
Hi everyone, I'm trying to implement the ISupportInitialize interface, in the object browser there implemented like the followinfg: Public Overridable Sub BeginInit() Public Overridable Sub...
5
by: owais | last post by:
Hi, I have a problem, I want to implements Parent class interface methods in child class. for e.g -------------- Test1.vb ---------------- Imports System Imports System.Web.UI Imports...
7
by: Chris Lane | last post by:
Hi, I have the following class declaration and the ide is giving the following errors. Interface 'System.Web.UI.IPostBackDataHandler' is already implemented by base class...
3
balabaster
by: balabaster | last post by:
Hey, I've been trawling documentation for this, but can't figure out what it's called so I'm running short of answers: In VB say you build some interface: Interface IDemoInterface Sub...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.