Solved

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

Posted on 2004-03-28
2
243 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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