?
Solved

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

Posted on 2004-03-28
2
Medium Priority
?
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
TheAvenger earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

752 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