|
-
February 11th, 2009, 11:58 AM
#1
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.
-
February 11th, 2009, 12:38 PM
#2
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
-
February 11th, 2009, 03:25 PM
#3
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);
}
-
February 11th, 2009, 05:21 PM
#4
Re: Display LINQ results inside a RichTextBox - howto
Thank you guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|