473,396 Members | 1,775 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.

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 1479

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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.