none
Error_1_'ConsoleApplication31.T' does not contain a definition for 'getdata' and no extension method 'getdata' accepting a first argument of type 'ConsoleApplication31.T' could be found (are you missing a using directive or an assembly reference?)_c:\user RRS feed

  • Question

  • using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace ConsoleApplication31
    {
        interface IEmployee
        {
            void getdata(int eno, string ename, double salary, int dno, string dname);
            void print(int eno, string ename, double salary, int dno, string dname);
        }
        class R
        {

        }

        class T : R, IEmployee
        {
            void IEmployee.getdata(int eno, string ename, double salary, int dno, string dname)
            {
                Console.WriteLine("Enter the employee no:");
                eno = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter the employee name:");
                ename = Console.ReadLine();
                Console.WriteLine("Enter the salary:");
                salary = Convert.ToDouble(Console.ReadLine());
                Console.WriteLine("Enter the department name:");
                dname = Console.ReadLine();
                Console.WriteLine("Enter the department no:");
                dno = Convert.ToInt32(Console.ReadLine());
            }
            void IEmployee.print(int eno, string ename, double salary, int dno, string dname)
            {
                Console.WriteLine("eno:" + eno);
                Console.WriteLine("ename:" + ename);
                Console.WriteLine("salary:" + salary);
                Console.WriteLine("dname:" + dname);
                Console.WriteLine("dno:" + dno);

            }
        }

        class Program
        {
            static void Main(string[] args)
            {
                T e = new T();
    IEmployee ie = e;
                e.getdata();
                e.print();
            }
        }
    }

    the error in the underlined lines

                   
    Tuesday, October 16, 2018 12:08 PM

All replies