Updating DataTable based on Criteria

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike9900

    Updating DataTable based on Criteria

    Hello,

    I want to update a DataTable based on some criteria, like using Case in a
    Query. I know I can use Select() on the table and then use loop to change the
    values, but I do not want to use loop. Is there a way?

    --
    Mike
  • Miha Markic [MVP C#]

    #2
    Re: Updating DataTable based on Criteria

    Why don't you use a loop anyway?

    --
    Miha Markic [MVP C#]
    RightHand .NET consulting & development www.rthand.com
    Blog: http://cs.rthand.com/blogs/blog_with_righthand/

    "Mike9900" <Mike9900@discu ssions.microsof t.com> wrote in message
    news:A5AFF12B-F863-40AE-BB54-98896B0D9391@mi crosoft.com...[color=blue]
    > Hello,
    >
    > I want to update a DataTable based on some criteria, like using Case in a
    > Query. I know I can use Select() on the table and then use loop to change
    > the
    > values, but I do not want to use loop. Is there a way?
    >
    > --
    > Mike[/color]


    Comment

    • Mike9900

      #3
      Re: Updating DataTable based on Criteria

      Performance reason
      --
      Mike


      "Miha Markic [MVP C#]" wrote:
      [color=blue]
      > Why don't you use a loop anyway?
      >
      > --
      > Miha Markic [MVP C#]
      > RightHand .NET consulting & development www.rthand.com
      > Blog: http://cs.rthand.com/blogs/blog_with_righthand/
      >
      > "Mike9900" <Mike9900@discu ssions.microsof t.com> wrote in message
      > news:A5AFF12B-F863-40AE-BB54-98896B0D9391@mi crosoft.com...[color=green]
      > > Hello,
      > >
      > > I want to update a DataTable based on some criteria, like using Case in a
      > > Query. I know I can use Select() on the table and then use loop to change
      > > the
      > > values, but I do not want to use loop. Is there a way?
      > >
      > > --
      > > Mike[/color]
      >
      >
      >[/color]

      Comment

      • Miha Markic [MVP C#]

        #4
        Re: Updating DataTable based on Criteria

        I don't get it. How do you think the value is applied? At some point it has
        to loop through the rows and change value.

        --
        Miha Markic [MVP C#]
        RightHand .NET consulting & development www.rthand.com
        Blog: http://cs.rthand.com/blogs/blog_with_righthand/


        "Mike9900" <Mike9900@discu ssions.microsof t.com> wrote in message
        news:BDB26B20-2BEF-4915-9A07-D4D66704599F@mi crosoft.com...[color=blue]
        > Performance reason
        > --
        > Mike
        >
        >
        > "Miha Markic [MVP C#]" wrote:
        >[color=green]
        >> Why don't you use a loop anyway?
        >>
        >> --
        >> Miha Markic [MVP C#]
        >> RightHand .NET consulting & development www.rthand.com
        >> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
        >>
        >> "Mike9900" <Mike9900@discu ssions.microsof t.com> wrote in message
        >> news:A5AFF12B-F863-40AE-BB54-98896B0D9391@mi crosoft.com...[color=darkred]
        >> > Hello,
        >> >
        >> > I want to update a DataTable based on some criteria, like using Case in
        >> > a
        >> > Query. I know I can use Select() on the table and then use loop to
        >> > change
        >> > the
        >> > values, but I do not want to use loop. Is there a way?
        >> >
        >> > --
        >> > Mike[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        Working...