Error "'object' does not contain a constructor that takes 1 arguments"

1

I wanted to know why this error is occurring.

I created a class that extends another one, but when I call its constructor (parent class) it generates an error.

There it says that there is no constructor with 1 parameter, but as you can see in the second image, there is.

    
asked by anonymous 01.07.2015 / 03:16

2 answers

4

In your code:

class MySQLConnection : MySqlConnection

In the superclass code:

public sealed class MySqlConnection : DbConnection, IDisposable, ICloneable

Basically, you should not inherit from MySqlConnection . There is no reason to do this and that sealed in the class declaration says that it is forbidden to inherit from it.

I do not know what you're trying to do, but whatever it is, you should not try to inherit from MySqlConnection .

In addition, having two classes whose name only differs in upper / lower case is a bad programming practice, as it is very confusing.

    
01.07.2015 / 03:36
-1

Try to do a different method:

public MySQLConnection(MySQLData data, MySQLUser user)
{
     base("meh");
} /* ou */
public MySQLConnection(MySQLData data, MySQLUser user)

If you can not, visit this link .

    
01.07.2015 / 03:38