Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure if this is the right forum to ask this, but here goes... is there a method for dynamically re-naming column names in a DataTable once it's been filled?

    TIA!

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    There are system level stored procedures that will let you do that, but if you are contemplating doing that from ASP.NET there are all sorts of pitfalls unless that is the only user of the database. And there are some circumstances where the sprocs will fail - for example if a table is replicated. Give us a bit more detail as to what motivates the idea of changing column names and perhaps we can suggest alternatives.
    Wendell

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    basically the issue i am working is, to load a datable with default data or with edited data. once that's done, the UI needs to display whichever set was loaded. since i use prefixes to define default data and edited data, when i try to assign controls to the data, if the prefix is for edit data, the system bombs. i thought to dynamically rename the column names but a better suggestion came up, which is to use the column number instead. so, no issue!

    Thanks anyway

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •