English 中文(简体)
Linq Tokou vs entities Framework Link Strings
原标题:Linq To SQL vs Entity Framework Connection Strings

感谢看我的职位。

我一直在与林克合作,以便 s,并且总体上很乐意,直到我刚刚注意到,数据库表名称被硬编码进入能够使我们环境工作的类别/dbml档案。 我们需要能够在一个地方通过网络(组合)完全改变数据库名称。 这是一项明确的要求。

你们是否知道如何在Linq To Sql之间实现这一点? 如果没有,实体框架是否以同样的方式行事? 也许我必须携带我的模型。

赞赏!

换言之,在数据校正档案中需要“Tourism_DB”:

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

以及 d本案文

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

用于NOT和网络的价值。 混为一谈。

最佳回答

此处发现的方法是最佳的。 它规定了整个进程。

问题回答

Dim c As New MyClassesDataContext(ConfigurationManager.ConnectionStrings("ConnectionString1").ToString())




相关问题
Possible to sandbox Python configuration file?

I m thinking of implementing a configuration file written in Python syntax, not unlike what Django does. While I ve seen one or two SO questions about the merits of using executable code in ...

How to validate Java logging properties files?

I have a basic facility for allowing users to remotely apply changes to the logging files in my application. Some logs are configured using java.util.logging properties files, and some are configured ...

Where should I put this configuration setting?

I m designing a fairly small web application which will run on a Sun application server (v9.1). It only has a few pages, no database of its own, and will retrieve/update data via web services. There s ...

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

Dependency bundle (jar-files/sources/API docs) in Eclipse

I m developing various in-house extensions for JIRA, the issue tracker we use. So far I worked with Netbeans and everything worked like a charm. However, now I need to switch to Eclipse and I m ...

热门标签