Hey guys,
I have a problem with connecting to database.
Everything works well on debug mode, but when I'm changing to RELEASE mode "Application Unfortunately has Stopped".
There is a problem with "con.Open();
What is going on here.
MySqlConnection con = new MySqlConnection("Server=bartuszak.pl;Port=3306;database=android;User Id=android;Password=##;charset=utf8"); try { if (con.State == ConnectionState.Closed) { con.Open(); MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = string.Format("SELECT ID,User_FirstName FROM Users WHERE User_Email ='" + txtEmailZaloguj.Text + "' AND User_Password='" + txtPasswordZaloguj.Text + "'"); cmd.Connection = con; MySqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { ZalogujSuccess = true; int ID = int.Parse(reader.GetString(0)); string User_FirstName = reader.GetString(1); txtSysLog.Text = string.Format("Zalogowny jako: {0}\nID: {1}\nZamknij dialog i kliknij zaloguj!", User_FirstName, ID); } else { txtSysLog.Text = "Błędne hasło lub email!"; } reader.Close(); } } catch (MySqlException ex) { txtSysLog.Text = ex.ToString(); } finally { con.Close(); }