Display LINQ results inside a RichTextBox - howto
I have this LINQ code:
Code:
var ang = from employee e1 in db.employees
orderby e1.hire_date descending
select new { e1.fname, e1.lname, e1.hire_date };
And I want to display the results into a RichTextBox.
I tried richTextBoxname.toString() but obviously did not worked.
Can anyone explain me how to display results in the richtextbox, since
I am not very familiar with C#.
Thank you.
Re: Display LINQ results inside a RichTextBox - howto
you need to append the text to the richtextbox\
Code:
richtextbox.AppendText(""myText");
Enumerate through your LINQ result and append each line to the richtextbox
Re: Display LINQ results inside a RichTextBox - howto
Code:
foreach (var a in ang)
{
richTextBox1.AppendText(a.fname + "\t" + a.lname + "\t" + a.hire_date);
}
Re: Display LINQ results inside a RichTextBox - howto