Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
public class Service1 : IService1
    {
        public DataSet GetEmployeerid()
        {
            String strConnection = ConfigurationManager.ConnectionStrings["MyConsString"].ConnectionString;
            SqlConnection conn = new SqlConnection(strConnection);
            SqlCommand cmd = new SqlCommand("select * from Employeertable where Employeerid=@Employeerid ", conn);
             conn.Open();
            SqlDataAdapter da=new SqlDataAdapter(cmd);            
             DataSet ds = new DataSet ();
             da.Fill(ds);
             return ds ;
            
}


Error:

'Employee.Service1' does not implement interface member 'Employee.IService1.GetEmployee(string)'
Posted
Updated 2-Jan-13 18:01pm
v2

Captain Obvious says: implement this interface. :-)

—SA
 
Share this answer
 
[OperationContract]
DataSet GetEmployeerid();

and add assembly using system.data;
 
Share this answer
 
The error means what it says. Your subject line is meaningless, if this is about an old question, edit it so people can see.

Your interface contains a method that your class does not implement. It says that in plain English. You need a GetEmployee method to have the whole interface present.
 
Share this answer
 
Seems you are new to WCF services and OOP...


Check the Iservice1.cs interface class. It has a interface method declared similar to this
C#
interface DataSet GetEmployee(string str)

which has one parameter as string.

Delete that interface from IService1.cs

.
 
Share this answer
 
Comments
Dhritirao's 3-Jan-13 0:49am    
thanks one doubt i have wrote public dataset and whereas in iservice1 what can be the return type. u suggested me interface dataset it is also not working..
bbirajdar 3-Jan-13 1:56am    
I told you to delete it... And interfaces do not have access specifiers. They are always public
Dhritirao's 3-Jan-13 2:02am    
initially also i didnt add any public in iservice1.cs i just declared dataset getemployee(string str)
bbirajdar 3-Jan-13 3:48am    
Let your code speak for you.. Post your code
bbirajdar 3-Jan-13 3:59am    
It should be - interface DataSet GetEmployee(string str) and not - dataset getemployee(string str)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900