Comma delimited cells to lookup table

  • Thread starter Thread starter CyberBless
  • Start date Start date
C

CyberBless

I have a cell in a MSSQL database that has comma delimited values.
I.E. ( "1", "2", "3","4" ).

These values represent property types. I.E.
1 = 1-Unit
2 = 2-Unit
3 = 3-Unit
4 = 4-Unit
5 = Condo
etc...

Lets assume there is no "look-up" table (I've search some 50 tables so
far and could'nt find a table that relates the values there is over 200
more tables to search and tables do not have recognizable or intuitive
names)

When I bind the data from this cell to a textbox I see "1", "2",
"3","4" exactly whats in the database which makes perfect sense. How
do I make it so these values show the appropriate text. So instead of
-> "1", "2", "3","4" <- I would see
1-Unit
2-Unit
3-Unit
ect...


How would I add or remove values from these cells/columns?

I'm programing with C# and is pretty new to .Net. Any help in this
matter would be greatly appreciated.


Thanx
Cyberbless
 
CyberBless,

Although you are using ADONET to get that value, is it in my opinion the
only relation to that and more a C# language question.

A good newsgroup for that is
microsoft.public.dotnet.languages.csharp

Probably the most simple for this is using the Regex
http://msdn.microsoft.com/library/d...stemtextregularexpressionsregexclasstopic.asp

Or just a complicated replace

However if I understand your message wrong and it is AdoNet related, than
please reply to tell it more.

Cor
 
I'm not quite sure where my question belongs either. I don't have a
problem using ADO.Net to get the values from the database. My problem
revolves around representing these values to the end user in a
meaningful way.

My goal would be to create a combo box that shows all 5 housing choices
with the ones that are selected highlighted. So if the cells returns
the values [ "1", "2" ], inside this combo box the "1-Unit" and the
"2-Unit" option would be highlighted. The "3-Unit", "4-Unit" and
"Condo" would be visible but not highlighted at this point the user
could click on any of the five units and add in doing so adds or removes
the corresponding value from the list. So referring back to that cell
that hypothetically contains the values [ "1", "2" ]; A user would click
"3-Unit in this combo box and the values in the cell would now read [
"1", "2", "3" ];

Thank you for taking the time out to help me with this question. Please
let me know if there is anything else I can provide in aiding with the
clarification of my question.


CyberBless
 
Back
Top