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 765945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:57:58+00:00 2026-05-14T16:57:58+00:00

Thanks for taking a look at my post. I’ve been working with linq to

  • 0

Thanks for taking a look at my post.

I’ve been working with linq to sql and have generally been happy, until i just noticed that database table names are hardcoded into the classes/dbml files– which can’t work in our environment. We need to be able to have database names completely changeable via web.config– in one place. That’s a definite requirement.

Do you know how this can be achieved with Linq To Sql? If not, does the Entity Framework behave in the same manner? Perhaps i will have to port my model.

Appreciated!

In other words, i need “Tourism_DB” in the DataContext file:

[System.Data.Linq.Mapping.DatabaseAttribute(Name="Tourism_DB")]
    public partial class TourismDataContext : System.Data.Linq.DataContext
    {

as well as this text in the dbml

<Database Name="Tourism_DB" Class="TourismDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">

to NOT be used, and the value in the web.config to be used anyway.

  • 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-14T16:57:59+00:00Added an answer on May 14, 2026 at 4:57 pm

    The method i found here worked the best http://msmvps.com/blogs/superska/archive/2009/03/13/linq-to-sql-connectionstring-in-web-config.aspx. It laid out the full process.

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

Sidebar

Related Questions

Thank you for taking the time to look at my post. I have an
and thanks for taking the time to look at my post. I am trying
and thanks for taking a look at the question. The background I have several
Thanks for taking a look at this. I’ve been looking and looking for a
Thank you for taking the time to look at my post. I have a
Thanks for taking a look at this. The issue has to do with the
First of all thanks for taking the time to look into this. I store
Thanks for taking the time to read this. I have an unknown number of
first of all thanks for taking your time! I'm a junior Dev, working with
Thanks everyone for taking the time to read this. I have styled my navigation

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.