c# 连接mysql

MySqlConnection connection = new MySqlConnectio(connectionString);

            using (MySqlCommand cmd = new MySqlCommand(safeSql, connection))

            {

                try

                {

                    connection.Open();

                    return cmd.ExecuteNonQuery();

                }

                catch (Exception ex)

                {

                    connection.Close();

                          return 0;

                }



            } 

你可能感兴趣的:(mysql)