views:

88

answers:

0
Dim db2 As New NewsDataContext
Dim filter As String = "System"
Dim Msg = From m In db2.Blog_Messages _
          **From c In db2.Blog_Comments _**
            Join u In db2.users On m.userID Equals u.userid _
            Where m.userID.Equals(filter) _
            **Where c.MessageID.Equals(myRec) _**
            Group c By c.MessageID Into g = Group _
            Select **myCount = g.Count(),** m.MessageID, m.Title, m.Message, u.username, date1 = m.AddedDate.ToShortDateString, Time = m.AddedDate.ToShortTimeString(), fullName = u.fname & " " & u.lname()

I want to pull the blog info and pull a count of a related table.. So for each blog i want to do a count of how many comments have been left for it, the above is not working when i added the parts for the comments count.. it gives me that m & u are not declared or not in the current scope...