Solved

Parsing table field Names for Display.. See below, makes more sense

Posted on 2004-03-28
2
237 Views
Last Modified: 2010-04-16
Hi Guru's, I have a database and all of the field names (i.e. CustomerId, ProductId, ThisField, AndThat, ...)
I would like to return these in my grid headers as Customer Id, Product Id, This Field, And That
Grid would look like:
Customer Id |  Product Id | This Field | And That
1                    2                 asdf           dff
3                    5                 asdf           dff
7                    2                 asdf           dff

Has anybody ever done this?
0
Comment
Question by:joshcrosby
2 Comments
 
LVL 20

Accepted Solution

by:
TheAvenger earned 500 total points
ID: 10701946
If you have the field name, you can try something like:

string originalName = "CustomerId";
string readableName = "";

foreach (char ch in originalName) {
  if (ch == Char.ToUpper(ch))
    readableName += " ";
  readableName += ch;
}
0
 
LVL 1

Author Comment

by:joshcrosby
ID: 10708525
Thanks TheAvenger
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now