Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. Updating list(of t) using LINQ

Updating list(of t) using LINQ

Scheduled Pinned Locked Moved LINQ
questioncsharplinqjsontutorial
8 Posts 2 Posters 19 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Simon_Whale
    wrote on last edited by
    #1

    Hopefully this will make sense Currently in an application I have a list of questions for example in the class below (have removed the properties for easy reading

    public Class SOF
    public Question_ID as integer
    public Question as string
    public ShortAnswer as string
    public LongAnswer
    end class

    I need to change the application so that the user can edit the long answer where necessary per client. I the updating of the list could be done with LINQ? if possible can anyone give me a pointer / article to read to achieve my goal? Many thanks Simon

    As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

    N 1 Reply Last reply
    0
    • S Simon_Whale

      Hopefully this will make sense Currently in an application I have a list of questions for example in the class below (have removed the properties for easy reading

      public Class SOF
      public Question_ID as integer
      public Question as string
      public ShortAnswer as string
      public LongAnswer
      end class

      I need to change the application so that the user can edit the long answer where necessary per client. I the updating of the list could be done with LINQ? if possible can anyone give me a pointer / article to read to achieve my goal? Many thanks Simon

      As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      You'll first need to clarify what flavor of Linq you are talking about. Linq to Objects, Linq to SQL, Linq to XML??? There are plenty of articles here and elsewhere. Where have you looked?


      I know the language. I've read a book. - _Madmatt

      S 1 Reply Last reply
      0
      • N Not Active

        You'll first need to clarify what flavor of Linq you are talking about. Linq to Objects, Linq to SQL, Linq to XML??? There are plenty of articles here and elsewhere. Where have you looked?


        I know the language. I've read a book. - _Madmatt

        S Offline
        S Offline
        Simon_Whale
        wrote on last edited by
        #3

        Mark thanks for your reply I'm looking at LINQ to objects. I have looked and still looking at articles around both CP and the internet.

        As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

        N 1 Reply Last reply
        0
        • S Simon_Whale

          Mark thanks for your reply I'm looking at LINQ to objects. I have looked and still looking at articles around both CP and the internet.

          As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          What are you having difficulty with then?


          I know the language. I've read a book. - _Madmatt

          S 1 Reply Last reply
          0
          • N Not Active

            What are you having difficulty with then?


            I know the language. I've read a book. - _Madmatt

            S Offline
            S Offline
            Simon_Whale
            wrote on last edited by
            #5

            I can find the object in a list, but I dont know how to update the found object

            As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

            N 1 Reply Last reply
            0
            • S Simon_Whale

              I can find the object in a list, but I dont know how to update the found object

              As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              Linq has nothing to do with updating an object once you have it

              List<MyOject> myList = new List<MyObject>();
              ...assume list is populated...
              MyOject obj = myList.First(e => e.Foo == "Bar");
              obj.Foo = "New Value";


              I know the language. I've read a book. - _Madmatt

              S 1 Reply Last reply
              0
              • N Not Active

                Linq has nothing to do with updating an object once you have it

                List<MyOject> myList = new List<MyObject>();
                ...assume list is populated...
                MyOject obj = myList.First(e => e.Foo == "Bar");
                obj.Foo = "New Value";


                I know the language. I've read a book. - _Madmatt

                S Offline
                S Offline
                Simon_Whale
                wrote on last edited by
                #7

                Mark Thanks for that Its so obvious now you've shown it thanks :-D

                As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

                N 1 Reply Last reply
                0
                • S Simon_Whale

                  Mark Thanks for that Its so obvious now you've shown it thanks :-D

                  As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.

                  N Offline
                  N Offline
                  Not Active
                  wrote on last edited by
                  #8

                  You're welcome


                  I know the language. I've read a book. - _Madmatt

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups