VB.NET LINQ Result Set Manipulation.

Posted by davemackey on Stack Overflow See other posts from Stack Overflow or by davemackey
Published on 2010-05-05T17:15:31Z Indexed on 2010/05/05 17:18 UTC
Read the original article Hit count: 247

Filed under:
|
|

I have a table that looks like this:

ID / Description / textValue / dateValue / timeValue / Type
1  / FRRSD       / NULL      / 2010-04-16 00:00:00.000 / NULL / classdates

Now I've got a LINQ command to pull only the rows where the type is classdates from this table:

 Dim dbGetRegisterDates As New dcConfigDataContext
 Dim getDates = (From p In dbGetRegisterDates.webConfigOptions _
                Where p.Type = "classdates" _
                Select p)

I now want to display the data in five different labels like so:

lblClass1.Text = "Your class is from " & getDates.Description("FRRSD").dateValue & "to " & getDates.Description("FRRCD").dateValue

Basically, I want to pull a row based on the description column value and then return the datevalue column value from that same row.

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about linq-to-sql