示例#1
0
        public static void Update(Objeto obj)
        {
            MySqlConnection connectionLive = databaseMySqlConnection();

            MySqlCommand command = new MySqlCommand("modificar" + obj.Tipo, connectionLive);

            command.CommandType = CommandType.StoredProcedure;

            Query(obj, connectionLive, command);
        }
示例#2
0
        private static void Query(Objeto obj, MySqlConnection con, MySqlCommand com)
        {
            foreach (Parametro param in obj.Parametros)
            {
                com.Parameters.AddWithValue(param.Arg, param.Value);
            }

            try
            {
                con.Open();

                com.ExecuteNonQuery();

                con.Close();
            }
            catch (MySqlException ex)
            {

            }
        }