Newbie needs help with updates RRS feed

  • Question

  • I'm trying to learn Linq to Sql through the videos, google and trial and error.  I like it better than strongly typed datasets because I can change table definitions without changing all the queries like I have to do is a dataset.  My problem is the same code that works in one place often doesn't work somewhere else.

    I' trying to to the following:

    see if I have specific records in the table

    update the records

    This is my code:

    Dim db As New ListAdminDataContext
    Dim jobSeekers = From member In db.Resumes _
                                 Where member.FILE2 = FILE2TextBox.Text _
                                 Select member

    for each member in jobSeekers
       jobSeeker.inFirst = "Frank"
       jobSeeker.inLast = "Burns"

    What am I doing wrong?

    Friday, January 23, 2009 8:17 PM


  • Your for-each variable is called 'member', but then you reference 'jobSeeker' in the loop.

    Wayward LINQ Lacky
    • Proposed as answer by NoHuman Monday, January 26, 2009 9:25 AM
    • Marked as answer by Damien GuardModerator Wednesday, April 15, 2009 3:54 AM
    Saturday, January 24, 2009 5:44 AM