Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:37:24+00:00 2026-05-22T19:37:24+00:00

I’m currently using a standard 4.0 Web Forms app (no dynamic data) and I’d

  • 0

I’m currently using a standard 4.0 Web Forms app (no dynamic data) and I’d like to try to make my site configuration as dynamic as possible.

I have a database table where each row represents a file type. I want to make a process where the site configuration is dynamic enough to handle and assimilate changes to its configuration based on changes to this table.

Currently I have a collection of entries in a configsection in my web.config file which represents a collection of file types. So maybe I’d have something like <add key="Pdf"> in a filetypes section if I want to be working with PDF files.

Each of these keys has an entry in my database, and I’m using an enum to map a friendly name/CLR object to the database value (integer). I like the way that I can then use this easily in a tag attribute e.g. <cc1:MyControl FileType="Pdf">, and I can use a combination of database data and additional attributes from web.config to allow Intellisense to really do its thing.

Problem is, this enum is hard-coded currently and I don’t know a good way to make this dynamic to handle future additions or deletions. As it stands, if I want to add a new file type I’d have to add a new row to the database, add an entry for it in the web.config, and then update the enum with the new ID. That’s okay for me, but it’s a bit manual and also I can’t speak for the ability of our support to follow that procedure.

I think what is causing a roadblock conceptually for me is the fact that instead of translating DB schema to CLR schema, I’m actually trying to convert a conglomeration of instances of a schema object to one type.

I am using entity framework so leveraging something in there is not a problem.

I was considering using xsd.exe, but as I’m not keen on scheduling it to run or calling it to refresh the schema, having fellow devs go through that process is probably more unwieldy than just updating the enum manually. However if there’s something I can do that route I am more than willing to check it out.

To clarify, I’m not really hung up on having this in web.config, this is just how I did it to get it to work nice and pretty-like in a hardcoded fashion.

Ideally, what I’d like to do is to have data that originates from the database auto-magically parsed and/or recognized, where I can just put its name or representation in plain English in a tag property. I’m thinking this is most likely going to look like some xml schema file that the client references.

If you have any suggestion, I’d really appreciate it. Thanks guys.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:37:24+00:00Added an answer on May 22, 2026 at 7:37 pm

    I ended up moving away from web.config. I could have made my own transform, but I decided to use a T4 template instead. I moved the data that was stored in web.config into fields in the database, then I used a T4 template to query the DB and get all of the rows and generate enumerated values for them. Then I created implicit operators to convert the enumerated type to an entity and vice versa, e.g. get{ return context.Where(myVar => myVar.myKey == (int) myEnumVal);

    So now my support doesn’t have to crack open the code, they just add a line in the database, and the design-time template will generate the new value(s).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.