Enroller.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HRSYSTEMPROJECT
{
     class Enroller : IEnroll
    {
        #region IEnroll Members

        public String Enroll(String a,String b ,String c,String d,String e)
        {

            return a;
            return b;
            return c;
            return d;
            return e;
        }


        internal string[] Enroll()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}


Interface IEnroll.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HRSYSTEMPROJECT
{
    public interface IEnroll
    {
        String Enroll();
    }
}
Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HRSYSTEMPROJECT
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }





        private void Form1_Load(object sender, EventArgs e)
        {
// TODO: This line of code loads data into the 'projectDataSet.EMPLOYEE' table. You can move, or remove it, as needed.
this.eMPLOYEETableAdapter.Fill(this.projectDataSet.EMPLOYEE);

        }



        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Enroller enrol = new Enroller();

            enrol.Enroll(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text);
            dataGridView1.Rows.Add(new Enroller().Enroll());


        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewCell oneCell in dataGridView1.SelectedCells)
            {
                if (oneCell.Selected)
                    dataGridView1.Rows.RemoveAt(oneCell.RowIndex);
            }
        }



    }

    public partial class Methods : Form1
    {




    }

}

It keeps saying that cannot implemenmt interface because it is not public. Why? What do I have to change?

So, what can you suggest to get rid of this error...

"Error 1 'HRSYSTEMPROJECT.Enroller' does not implement interface member 'HRSYSTEMPROJECT.IEnroll.Enroll()'. 'HRSYSTEMPROJECT.Enroller.Enroll()' cannot implement an interface member because it is not public.
"

I do not know. If your initial problem is solved, then it is good practice to mark this thread solved. Then start a new one for your new problem, explaining a little clearer what you have and what you want to happen.

This article has been dead for over six months. Start a new discussion instead.