una realizar pasos para net los generales desde describa datos crear consultas conexión conexion conectar con como cadena asp asp.net sql-server sql-server-2008 database-connection connection-string

asp.net - realizar - Se produjo un error relacionado con la red o específico de la instancia al establecer una conexión con SQL Server



crear conexion a sql server c# (1)

Implementé mi aplicación web asp.net en somee.com, cada vez que inicio sesión en este sitio (ipc.somee.com) me da un error relacionado con la red como:

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) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: 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) Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SqlException (0x80131904): 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)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5296071 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +558 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +5308555 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +145 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +920 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +307 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) +434 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +5311099 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +37 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions) +558 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions) +67 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1052 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +167 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +143 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +83 System.Data.SqlClient.SqlConnection.Open() +96 Default.log(Object sender, EventArgs e) in c:/users/sreekanth/documents/visual studio 2010/Projects/IPCWebApp/IPCWebApp/Default.aspx.cs:43 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +124 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724


El servidor Sql desencadena este error cuando su aplicación no tiene suficientes derechos para acceder a la base de datos. hay varias razones sobre este error. Para solucionar este error, debe seguir las siguientes instrucciones.

  1. Intenta conectar el servidor sql desde tu servidor usando el estudio de administración. si usa la autenticación de Windows para conectar el servidor SQL, configure la identidad del grupo de aplicaciones con el administrador del servidor.

  2. si usa la autenticación de servidor sql, verifique la cadena de conexión en web.config de su aplicación web y configure la identificación de usuario y la contraseña del servidor sql que le permite iniciar sesión.

  3. si su base de datos en otro servidor (acceda a la base de datos remota), primero habilite el acceso remoto al servidor sql desde el servidor sql y habilite TCP / IP desde el administrador de configuración del servidor sql.

  4. después de hacer todas estas cosas y aún no puede acceder a la base de datos, verifique el firewall del servidor donde intenta acceder a la base de datos y agregue una regla en el firewall para habilitar el puerto del servidor sql (de forma predeterminada, use el servidor sql 1433 para verificar puerto del servidor sql que necesita para verificar el protocolo de red del administrador de configuración del servidor SQL TCP / IP puerto).

  5. si su servidor sql se está ejecutando en una instancia con nombre, entonces necesita escribir el número de puerto con el nombre del seridor sql, por ejemplo 117.312.21.21/nameofsqlserver,1433.

  6. Si está utilizando un alojamiento en la nube como amazon aws o microsoft azure, el servidor o la instancia se ejecutará detrás del firewall en la nube, por lo que deberá habilitar el puerto 1433 en el firewall en la nube si tiene una instancia predeterminada o un puerto específico para SQL Server.

  7. Si está utilizando Amazon RDS o SQL Azure, debe habilitar el puerto del grupo de seguridad de esa instancia.

  8. Si está accediendo al servidor sql a través del modo de autenticación del servidor sql, asegúrese de habilitar la propiedad de instancia del servidor sql "SQL Server and Windows Authentication Mode".

    1. Reinicie su instancia de servidor sql después de realizar cualquier cambio en la propiedad ya que algunos cambios requerirán reiniciarse.

Si además enfrenta alguna dificultad, entonces necesita proporcionar más información sobre su sitio web y su servidor sql.