错误=> asp.net中与网络相关或特定于实例的错误 [英] error => network-related or instance-specific error in asp.net

查看:62
本文介绍了错误=> asp.net中与网络相关或特定于实例的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..我在网站面板上传了我的网站

但是当我想在我的网站上登录时,发生了一个错误。

这是错误:



建立与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)

并在我的数据库中成功恢复。



我很困惑。任何人都可以帮助我?

解决方案

错误信息确切地说出了什么问题!

错误:

找不到服务器或无法访问服务器。验证实例名称是否正确,并且SQL Server配置为允许远程连接。





请阅读:

配置远程访问服务器配置选项 [ ^ ]

配置Windows防火墙以允许SQL Server访问 [ ^ ]



连接字符串错误!看起来你正试图附加数据库,但你写道,它已成功附加。

http ://www.connectionstrings.com/sql-server/ [ ^ ]


数据源或服务器名称或IP地址是正确的。例如localhost。您也可以使用。(点)代替机器名称。对于

示例.\SQLExpress



2.如果使用任何实例,请检查实例名称是否正确。例如这里SQLExpress



3.如果有任何远程连接检查是否安装了防火墙,如果是,则禁用它。



4.还要检查SQL Server中是否配置了远程连接。要配置SQL Server以允许远程连接,请阅读此处。本文

还解释了如何在防火墙中创建例外以允许远程连接。



也检查..

A-网络相关或 - 实例特定-错误出现-而确立-A-连接到 [<一个href =http://stackoverflow.com/questions/16256533/a-network-related-or-instance-specific-error-occurred-while-establishing-a-connetarget =_ blanktitle =New Window > ^ ]

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 ?

解决方案

The error message says exactly what is wrong!

error:

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.



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/[^]


Data Source or Server Name or IP address is Correct. For example here localhost. You can also put a .(dot) instead of machine name. For
example .\SQLExpress

2. If any instance used check whether the instance name is correct. For example here SQLExpress

3. If any remote connections check if there is some firewall installed if yes disable it.

4. Also check if remote connections are configured in SQL Server. To configure SQL Server to allow remote connections read here. This article
also explains how to create an exception in firewall in order to allow remote connections.

also check ..
A-network-related-or-instance-specific-error-occurred-while-establishing-a-conne[^]


这篇关于错误=&gt; asp.net中与网络相关或特定于实例的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆