Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-03-28
2
Medium Priority
?
252 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 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