When I try to insert to my DataBase I got error Parameter '@email' must be defined my code:
MySqlCommand cmd = new MySqlCommand("INSERT INTO users VALUES(@email,@password,@firstName,@LastName,@UserID,@address,@birthday,0)", con);
cmd.Parameters.AddWithValue(@email, email);
cmd.Parameters.AddWithValue(@password, password);
cmd.Parameters.AddWithValue(@firstName, firstName);
cmd.Parameters.AddWithValue(@LastName, LastName);
cmd.Parameters.AddWithValue(@UserID,UserID);
cmd.Parameters.AddWithValue(@address, address);
cmd.Parameters.AddWithValue(@birthday, birthday);
/*THE PROBLEM ISNT IN THE DATABASE,THE FOLOOW INSERT STATMENT WORK!"*/
// MySqlCommand cmd = new MySqlCommand("INSERT INTO users VALUES('evyataresdxez','sdfs','sdfsdf','sdds',33,'sdfsdf','232',0)", con);
con.Open();
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
I have no problem in the database/code because the code in the comment is work good. thanks