MySqlConnection oConn =
new MySqlConnection("Database=amjames_webApp;Data Source=localhost;User id=amjames_webApp;Password=This Is Not Yes");
oConn.Open();
MySqlCommand command =
new MySqlCommand("pestAdd", oConn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new MySqlParameter("?IcompanyName", MySqlDbType.VarChar, 30));
command.Parameters.Add(new MySqlParameter("?IsiteName", MySqlDbType.VarChar, 30));
command.Parameters.Add(new MySqlParameter("?Icontact", MySqlDbType.VarChar, 30));
command.Parameters.Add(new MySqlParameter("?Itelephone", MySqlDbType.VarChar, 30));
command.Parameters.Add(new MySqlParameter("?Iemail", MySqlDbType.VarChar, 30));
command.Parameters.Add(new MySqlParameter("?Inotes", MySqlDbType.VarChar, 5000));
command.Parameters[0].Value = txtCompanyName.Text;
command.Parameters[1].Value = txtSiteName.Text;
command.Parameters[2].Value = txtContact.Text;
command.Parameters[3].Value = txtTelephine.Text;
command.Parameters[4].Value = txtEmail.Text;
command.Parameters[5].Value = txtNotes.Text;
command.ExecuteNonQuery();
oConn.Close();
Is this code server-side or client side? x10's servers have firewalls that only allow the mySQL database to connect through localhost, thus the files have to be on this server.Im also getting the
Access denied for user 'amjames_webApp'@'localhost' (using password: YES)
im using C# but know im getting my username and password right
Code:MySqlConnection oConn = new MySqlConnection("Database=amjames_webApp;Data Source=localhost;User id=amjames_webApp;Password=This Is Not Yes"); oConn.Open(); MySqlCommand command = new MySqlCommand("pestAdd", oConn); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new MySqlParameter("?IcompanyName", MySqlDbType.VarChar, 30)); command.Parameters.Add(new MySqlParameter("?IsiteName", MySqlDbType.VarChar, 30)); command.Parameters.Add(new MySqlParameter("?Icontact", MySqlDbType.VarChar, 30)); command.Parameters.Add(new MySqlParameter("?Itelephone", MySqlDbType.VarChar, 30)); command.Parameters.Add(new MySqlParameter("?Iemail", MySqlDbType.VarChar, 30)); command.Parameters.Add(new MySqlParameter("?Inotes", MySqlDbType.VarChar, 5000)); command.Parameters[0].Value = txtCompanyName.Text; command.Parameters[1].Value = txtSiteName.Text; command.Parameters[2].Value = txtContact.Text; command.Parameters[3].Value = txtTelephine.Text; command.Parameters[4].Value = txtEmail.Text; command.Parameters[5].Value = txtNotes.Text; command.ExecuteNonQuery(); oConn.Close();