Ejemplo n.º 1
0
        protected override void Execute(CodeActivityContext context)
        {
            var table      = DT.Get(context);
            var connection = Database_Connection.Get(context);
            var t          = Table.Get(context);


            connection.Open();

            MySqlCommand com = connection.CreateCommand();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                com.CommandText = "INSERT INTO " + t + " VALUES(@First_Name, @Last_Name)";
                com.Parameters.AddWithValue("@First_Name", table.Rows[i]["First_Name"]);
                com.Parameters.AddWithValue("@Last_Name", table.Rows[i]["Last_Name"]);
                com.ExecuteNonQuery();
            }

            connection.Close();
        }