问题描述
嗨..我在网站面板上传了我的网站
但是当我想在我的网站上登录时,发生了一个错误。
这是错误:
建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供者:SQL网络接口,错误:26 - 查找指定服务器/实例时出错)
我的连接字符串是:
< add name = MyConnectionString connectionstring = Data Source = localhost; Initial Catalog = NameOfDatabase.mdf; Persist Security Info = True; User ID = UserName; Password = mypass / >
(我的服务提供商说上面的格式。)
我在我的电脑上使用的数据库(在上传网站之前)是ASPNETDB.mdf(我自动创建的时候)使用Asp.net配置页面)(sql express 2008)
我从ASPNETDB.mdf备份并在网站面板中创建一个具有不同名称的数据库,然后将备份恢复到它
(网站面板中的sql server版本是sql server 2012)
并在我的数据库中成功恢复。
我很困惑。任何人都可以帮助我?
请阅读:
[]
[]
连接字符串错误!看起来你正试图附加数据库,但你写道,它已成功附加。
[]
Hi.. I uploaded my site in website panel
but when I want to login in my site , an error has occured.
this is error :
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)
my connection string is :
<add name="MyConnectionString" connectionstring="Data Source=localhost;Initial Catalog=NameOfDatabase.mdf;Persist Security Info=True;User ID=UserName;Password=mypass" />
(my service provider says the above format.)
database that I used in my computer(before upload site) is ASPNETDB.mdf(automatically created when I used Asp.net configuration page)(sql express 2008)
I backup from ASPNETDB.mdf and in website panel I create a database with different name and then restore backup to it
(version of sql server in website panel was sql server 2012 )
and it seccessfully restored in my database.
I confused. can anyone help me ?
Please, read this:
Configure the remote access Server Configuration Option[^]
Configure the Windows Firewall to Allow SQL Server Access[^]
Connection string is wrong! It looks like you're trying to attach database, but you wrote, it was successfuly attached.
http://www.connectionstrings.com/sql-server/[^]
这篇关于错误=> asp.net中与网络相关或特定于实例的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!