locked
Step through records of a table RRS feed

  • Question

  • User-1852975005 posted

    Hi,

        how to step through the records of a table and write concatonation of each record to seperate line in body of email.

    Thanks,

    Wednesday, July 5, 2017 3:09 PM

Answers

  • User-1852975005 posted

    Hi,

                    var Blocks = _context.PLCBlock.ToList();
                    var BodyContentTemp = "";
                    foreach (var Block in Blocks)
                    {
                        BodyContentTemp = $"The PLC Type is a {Block.BlockType} with Number {Block.Number} and with a Description of {Block.Description}\r\n";
                        BodyContent = BodyContent + BodyContentTemp;
                    }

    Thanks,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 5, 2017 3:10 PM