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. C#
  4. Data table in C#

Data table in C#

Scheduled Pinned Locked Moved C#
csharpdatabasehelpquestion
3 Posts 2 Posters 0 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.
  • D Offline
    D Offline
    dalbhide bipin
    wrote on last edited by
    #1

    Hi I have problem with data table in C#.In the code below i have data table which contains some values. "dt" is DataTable object and "dr" is DataRow[] object. when i fire some query on datatable using select method, it returns some datarows which fulfill the expression. And when i modify any column value of datarow like column "ID" it also modifies the values in datatable dt. Can you tell me why this is happening? I don't want to modify values in datatable dt. Thank you. Class prog { static void Main(string[] args) { dr = dt.Select(expression); dr[0]["ID"] = 10; } }

    G 1 Reply Last reply
    0
    • D dalbhide bipin

      Hi I have problem with data table in C#.In the code below i have data table which contains some values. "dt" is DataTable object and "dr" is DataRow[] object. when i fire some query on datatable using select method, it returns some datarows which fulfill the expression. And when i modify any column value of datarow like column "ID" it also modifies the values in datatable dt. Can you tell me why this is happening? I don't want to modify values in datatable dt. Thank you. Class prog { static void Main(string[] args) { dr = dt.Select(expression); dr[0]["ID"] = 10; } }

      G Offline
      G Offline
      Gareth H
      wrote on last edited by
      #2

      dalbhide bipin, The datarow references the datatable, so they are "one". Why are you trying to only edit the datarow and not the table? eg: What are you doing? Regards, Gareth.

      D 1 Reply Last reply
      0
      • G Gareth H

        dalbhide bipin, The datarow references the datatable, so they are "one". Why are you trying to only edit the datarow and not the table? eg: What are you doing? Regards, Gareth.

        D Offline
        D Offline
        dalbhide bipin
        wrote on last edited by
        #3

        thanks.. i got it...

        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