English 中文(简体)
IIS:Linking to mdf database - web config problem
原标题:IIS: Connecting to .mdf database - web config problem

当地我与北风联系。 mdf,但当我向遥远服务器上载时,我会发现以下错误:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

我尝试的这些选择很少:

<connectionStrings>
        <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
    </connectionStrings>

上述工作在当地进行。

<connectionStrings>
            <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=D:ASPTestSiteApp_DataNorthwind.mdf; Integrated Security=True;Connect Timeout=30;User Instance=True;Trusted_Connection=Yes"/>
        </connectionStrings>

2005年安装服务器

Thanks,
Ilija

最佳回答

Follow these steps: 1: Attach your Northwind.mdf to your Sql Server 2005 on your server using the Sql server Management studio. 2: Modify the connectionstring in your web.config so that it points to the db on your server.

rel=“nofollow> How to detach /annex db.

问题回答

• 检查:

  1. Is the database file really at that location?
  2. Does the app pool have read/write rights to that directory?
  3. Are the SQL Express services actually running?
Data Source=.\SQLEXPRESS;AttachDbFilename=D:\ASPTestSite\App_Data\Northwind.mdf;Integrated Security=True;User Instance=True

之后改为。 • 如何配置2005年服务器,以便远程连接

并且肯定北风的位置。 m!

这里要检查几个要点:

  • 如果你重新部署到一个共享的托管环境,那么,东道方在网络服务器上赢得机库的运行。 要求他们确认并向你提供。

  • 联系使你重新利用怀疑。 如果服务器安装在你的服务器上,但作为“Default”的机体,你不需要SQLEXPRESS部分连接Data Source/code>。 Just use . or ( local).

  • 如果的确安装了快车,并安装了标语<编码>SQLEXPRESS,那么就检查了该站点的识别标志和贵国数据库的正确许可。 这一身份可以是工人过程账户(NETRKWO SERVICE,ApplicationPoolIdentity,定制账户),也可以是工地信息系统匿名账户(如果能够提供ASP.NET冒名)。

我的最后一点是重要的:

  • The AttachDbFilename and User Instance=True are specific to SQL Express which supports a concept known as "User Instances". This feature is not suitable for dedicated or shared hosting environments.

我的建议是:

  • find out exactly what version AND edition of SQL Server is available for you to use
  • find out where its hosted (locally on your server, or on another machine)
  • find out if it s configured as the "Default" instance or a named instance




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签