473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Load Data from Database as Class Properties or enum

Hi,

I have a table with the data like this,

ID Status Description
1 R Read
2 U UnRead
D D Deleted

I want to load this data in a class (say named Status) which I want to use
through out my project and should be able to access it like,

Status.Read or
Status.UnRead or
Status.Deleted

with each returning their corresponding values as in the database table
shown above.

To sum it up I want to create an enum with values loaded from database. I
think it may be possible using Reflection or Custom Attributes but don't know
how to do it.

One more thing is if I use reflection than I guess I won't be able to use
Status.Read in design time which means no use of it, correct me if I am wrong.

Any ideas how to go about it?

Regards,
Waqas Pitafi
Nov 18 '05 #1
0 940

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Waqas Pitafi | last post by:
Hi, I have a table with the data like this, ID Status Description 1 R Read 2 U UnRead D D ...
0
by: Jeff Patrick | last post by:
I have a series of class libraries. Some of the functions require string constants to be passed in in order to effect certain behavior. Over time the list of strings that could be passed in grew...
0
by: keith bannister via .NET 247 | last post by:
(Type your message here) -------------------------------- From: keith bannister Hi, I'm new to .net (as of last week) but here goes. I want to serialize/deserialize a file the conforms...
5
by: Keith Bannister | last post by:
I'm new to .net so here goes. I'm tying to deserialize a class that is associated with an XML schema. I created the C# class with xsd.exe as below: xsd.exe /c /n:somenamespace...
1
by: newbie | last post by:
Hello, I am using a propertygrid to allow users to edit\create objects at runtime, that can update records in a database. There are certain properties (fields) that I wish to display as...
2
by: David Batt | last post by:
Hello I have a problem whereby I wish to setup a custom tooltip. I have the code attached to do this, it all works very wel if you have the following code in a button click event on the form ...
4
by: CPD | last post by:
From PHP, doing a DROP TABLE and a CREATE TABLE is successful, but doing a LOAD FILE keeps failing, with the error "Access denied for user 'db_user'@'localhost' (using password: YES)". The...
8
by: Ryan Liu | last post by:
Is that a good idea to add a Hashtable to System.Windows.Forms.Application class? And we can put any user global data in it. I have some class library used by a few other applications in slight...
2
by: Michael Bray | last post by:
With the recent release of EF I've decided to dig into it a bit more than I did before... the question I'm specifically interested in, but haven't been able to find a resource to answer it is......
3
by: Queez | last post by:
Very quick question. I have a master page (M1) and three content pages (C1, C2, C3). In M1, there's a list of three anchors (A1, A2, A3) which point towards the three content pages. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.