我一直在寻找类似的问题并查看了大多数类似的问题,但没有一个答案是有用的......
我收到此错误:
不一致的可访问性:参数类型'FinalProject.MySQL'不如方法'FinalProject.Form2.Form2(FinalProject.MySQL)'
namespace FinalProject
{
public partial class Form2 : Form
{
MySqlConnection c;
public Form2(MySqlConnection connection) //this is the line of the error.
{
InitializeComponent();
c = connection;
}
private void okBtn_Click(object sender, EventArgs e)
{
if (c.State == ConnectionState.Open)
{
textBox1.Text += "conection open";
}
}
}
}
namespace FinalProject
{
public class MySQL
{
public MySqlConnection connection;
private string server;
private string port;
private string database;
private string uid;
private string password;
//Constructor
public MySQL()
{
Initialize();
}
//Initialize values
private void Initialize()
{
.
.
.
我试图将“公共”修饰符放在我能想到的所有内容上......没有运气:)))