views:

102

answers:

2
If Not IsPostBack Then
Dim q=From f In System.Drawing.FontFamily.Families _
Select f.Name
ListBox1.DataSource = q
ListBox1.DataBind()
End If

I'm new to LinQ and I'm following a VB.Net tutorial so I don't know Linq in C#. Can anyone translate this to C# for me?

+2  A: 
var q = from f in System.Drawing.FontFamily.Families select f.Name;
Pierre-Alain Vigeant
+2  A: 

I'm surprised none of the popular conversion sites support LINQ syntax (as far as I can tell)

if(!IsPostBack)
{
    var q = from f in System.Drawing.FontFamily.Families select f.Name
    ListBox1.DataSource = q;
    ListBox1.DataBind()
}
Rex M
lol Thanks Rex, I always recognize you from the avatar. Thanks again, bro! :D
Sergio Tapia
Glad to help... brah
Rex M