• Using DDL commands on a DataTable

    • This topic has 2 replies, 2 voices, and was last updated 15 years ago.
    Author
    Topic
    #467620

    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!

    Viewing 1 reply thread
    Author
    Replies
    • #1214722

      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.

    • #1214723

      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

    Viewing 1 reply thread
    Reply To: Using DDL commands on a DataTable

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: