Question

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#. How can this be translated to C#?

Was it helpful?

Solution

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()
}

OTHER TIPS

var q = from f in System.Drawing.FontFamily.Families select f.Name;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top