Start New Discussion within our Software Development Community

When i enter the following code I get an error saying "method must have a return type" could somebody please explain what needs to be done to correct this error.

Thanks,

public EditDialog(DataRow row)
        {
            editRow = row;
            InitializeComponent();
            PopulateForm();


        }

here try entering it like this

public void EditDialog(DataRow row)
 {
  editRow = row;
  InitializeComponent();
  PopulateForm();
 }

The only time you can get away without using void or a return type other then that (that I can think of) is when you create an item (or a form)

for form

namespace myNameSpace
 {
//=======================================================================================================
  public partial form1 : Form
   {
//-------------------------------------------------------------------------------------------------------
    public form1()

or an object

namespace myNameSpace
 {
//=======================================================================================================
  public class myClass
   {
//-------------------------------------------------------------------------------------------------------
    public myClass()
     {
This question has already been answered. Start a new discussion instead.