08-29-2012, 11:29 AM
Forgot all this i got a Fix but not really Logical..
Look this Class i marked where you should read ^^:
class Force
{
public Force()
{
Initialize();
}
public string Server;
private string UserID;
private string DB;
private string pw;
public void Initialize()
{
Form1 f1 = new Form1();
f1.Show(); // Here is the Fail, if i let it Open i can connect but if i dont include this it tells me the Error..
Server = f1.textBox1.Text;
UserID = f1.textBox3.Text;
DB = f1.textBox5.Text;
pw = f1.textBox4.Text;
}
public void MySql()
{
MySqlConnection con;
MySqlConnectionStringBuilder csb = new MySqlConnectionStringBuilder();
csb.Server = Server;
csb.UserID = UserID;
csb.Database =DB;
csb.Password = pw;
con = new MySqlConnection(csb.ConnectionString);
MySqlConnection connection = new MySqlConnection(csb.ConnectionString);
connection.Open();
}
}

