skip to Main Content

How do I add the same record in MySQL

How to add the same record in MySQL, like the same Lastname only. create table Person (Lastname varchar(15) primary key, Firstname varchar(15), Address varchar(30), Province varchar(30)); insert into Persons values ('Soriano', 'MamaMo', 'Sa tabi-tabi', 'Pangasinan'); ERROR 1062 (23000): Duplicate entry…

VIEW QUESTION

MySqlConnector – Parameter in dynamic string query won't be set

@pname is the parameter set in C# code by: using (MySqlCommand dynamicQueryCommand = new MySqlCommand(dynamicQueryWithParameter, conn)) { dynamicQueryCommand.Parameters.Add("@pName", MySqlDbType.String); dynamicQueryCommand.Parameters["@pName"].Value = "John"; using (MySqlDataReader dynamicQueryReader = dynamicQueryCommand.ExecuteReader()) { string output = ""; object[] values = new object[dynamicQueryReader.FieldCount]; while (dynamicQueryReader.Read()) {…

VIEW QUESTION

"readDefaultFile" connection property is not working when used in C++ code using mysql-connector-c++-8.0.33

I am using mysql-connector-c++-8.0.33 and C++ code to connect to database. Here is the code, try { sql::Driver *driver; sql::Connection *con; sql::Statement *stmt; sql::ResultSet *res; sql::ConnectOptionsMap connection_properties; driver = get_driver_instance(); connection_properties["hostName"] = "localhost"; connection_properties["userName"] = "correctusername"; connection_properties["password"] = "correctpassword"; connection_properties["schema"]…

VIEW QUESTION
Back To Top
Search