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. Problem with datatable

Problem with datatable

Scheduled Pinned Locked Moved C#
helpcssquestion
2 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.
  • S Offline
    S Offline
    Shaahinm
    wrote on last edited by
    #1

    Hi, I have a datatable which is going to fill from a if statment (I mean I don't know which record is going to returned) and after the data is returned i want to be able to edit or delete the returned records. (the IF's are a search statment all on one table and diffrent columns) so when S.O wants to delete a record i want to refresh the Grid which is filled with datatable. how can i refresh the datatable. (I hope i was able to express what I mean) please help me.:D

    C 1 Reply Last reply
    0
    • S Shaahinm

      Hi, I have a datatable which is going to fill from a if statment (I mean I don't know which record is going to returned) and after the data is returned i want to be able to edit or delete the returned records. (the IF's are a search statment all on one table and diffrent columns) so when S.O wants to delete a record i want to refresh the Grid which is filled with datatable. how can i refresh the datatable. (I hope i was able to express what I mean) please help me.:D

      C Offline
      C Offline
      CKnig
      wrote on last edited by
      #2

      I strongly advise to use SQL to get only the data you want. If this is not possible you will have to use loop to step through all returned rows and fill a new DataTable with only the rows you want (ImportRow) (no a DataView won't help if you can't use SQL to filter). If you may use LINQ it's getting simpler - just use where with your IF (for example: var FilteredDT = from c in originalTable where (c => (statements from the if for c - for example c.Name.StartsWith("x"))) select c;

      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