R
Roshawn
Hi all,
I've tried just about everything trying to get the following code to work:
Protected Sub Selecting(ByVal sender As Object, ByVal e As LinqDataSourceSelectEventArgs)
Dim db As myDataContext = New myDataContext(my_SQL2005Express_connection_here)
Dim brands = db.GetBrands() 'I get an error here
Dim alphabets() As Char = New Char() {"A", "B", "C", "D", "E", "F", "G"}
e.Result = From a In alphabets _
Group Join p In brands On a Equals p.name Into g = Group _
Order By a _
Select New With {.Key = a, .Count = g.Count(), _
.Brands = From f In g Order By f.name Select New With {.Text = f.name, _
.Link = f.name & ".aspx"}}
End Sub
I don't know what's happening, but using the DataContext object seems to yield no results.
Instead I get the this error: "The query results cannot be enumerated more than once."
What does this error mean? I've tried repeatedly to work around it, but it still persists.
Please help,
Roshawn
I've tried just about everything trying to get the following code to work:
Protected Sub Selecting(ByVal sender As Object, ByVal e As LinqDataSourceSelectEventArgs)
Dim db As myDataContext = New myDataContext(my_SQL2005Express_connection_here)
Dim brands = db.GetBrands() 'I get an error here
Dim alphabets() As Char = New Char() {"A", "B", "C", "D", "E", "F", "G"}
e.Result = From a In alphabets _
Group Join p In brands On a Equals p.name Into g = Group _
Order By a _
Select New With {.Key = a, .Count = g.Count(), _
.Brands = From f In g Order By f.name Select New With {.Text = f.name, _
.Link = f.name & ".aspx"}}
End Sub
I don't know what's happening, but using the DataContext object seems to yield no results.
Instead I get the this error: "The query results cannot be enumerated more than once."
What does this error mean? I've tried repeatedly to work around it, but it still persists.
Please help,
Roshawn