473,324 Members | 2,178 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,324 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 1476

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.