I am getting the following error
Inconsistent accessibility: parameter type \'Db.Form1.ConnectionString\' is less accessible than method \'Db.Form1.B
Your ConnectionString
type is not public
, yet, a public method of a public class is using it as a parameter. You must also make the type public
, for instance:
// If it's a class
public class ConnectionString { ... }
As described here, classes and structs are private by default if no access modifier is specified. Where you have defined your struct as:
struct ConnectionString
{
public string Provider;
public string DataSource;
public string UserId;
public string Password;
public string Database;
}
you need to instead define it as:
public struct ConnectionString
{
public string Provider;
public string DataSource;
public string UserId;
public string Password;
public string Database;
}