tags:

views:

73

answers:

2

Hello,

I am trying to create a very simple CUser class in my project, but apparently I am doing something wrong. Here is the code:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySql.Data.MySqlClient;

namespace admin.NET.lib {
    public class CUser {
        protected MySqlConnection conn;

        public void CUser() {
        }
    }
}

This simple piece of code gives me:

'CUser': member names cannot be the same as their enclosing type

Can anyone give me a hint to where I must modify this to work. I saw that this problem poped before but I could not adapt the solutions to my code.

Thanks

+9  A: 

Remove the void. Constructors have no return type.

John Saunders
A: 

Bad constructor. Read .net base information.

ASergan
Isn't that pretty much what I said? Also, reading .NET "base information" won't help him. He would need to read C# "base information".
John Saunders