We help IT Professionals succeed at work.

C# -- "DataGridView" Column Name Changing ?

finance_teacher
on
794 Views
Last Modified: 2013-12-17
How can I get the below to
work on my existing DataSet1.xsd
without doing the long "Temp Solution"
on each Form I have ?

Basically I want to change the column
name in ONE place (i.e. DataSet1.xsd)
-------------------------------------------------------
Issue
 1. create new attached APP
      ** open DataSet1.xsd
      ** click on GML_CATEGORYTableAdapter
      ** Properties WINDOW
      ** delete Delete, Insert, and Update
         "CommandText" sections, leave Select as-is
 2. drop DataSources
    "GML_CATEGORY" table onto form
 3. run app
 4. works
 5. change "GML_CATEGORY" table,
    "DESCRIPTION" column to "DESCRIPTION_"
    (trailing underline) in Oracle,
    make no changes in DataSet1.xsd
      ALTER TABLE GML_CATEGORY
      RENAME COLUMN DESCRIPTION TO DESCRIPTION_;
 6. build app --> get no errors
 7. run app
 8. get ORA-00904: "DESCRIPTION":
    invalid identifier error in Form1.cs
    before app starts
 9. do a search for "DESCRIPTION"
10. find that it is used in 58 lines,
    but cannot do an "find", "replace" since
    this would replace other non-database
    "DESCRIPTION" text that I don't want to change
11. do "Temp Solution" below
-------------------------------------------------------
Temp Solution
 1. open DataSet1.xsc
 2. click on GML_CATEGORYTableAdapter
 3. Properties WINDOW
 4. change Select "CommandText"
    section to below
      ** SELECT ID, DESCRIPTION_ FROM GML_CATEGORY
 5. press ENTER on keyboard
 6. click "Yes" on "Do you want to regenerate updating commands"
      ** automatically deletes old "DESCRIPTION"
          column from Form1 DataGridView
 7. open Form1 DataGridView
 8. add new "DESCRIPTION_"
 9. run app
10. works
11. manually remember other 50+ other
    forms that had DESCRIPTION column
12. repeat above step #7 and #8
    for each one of these forms
Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.