Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Maria Carolina Costa

Server Error in '/' Application.

Recommended Posts

Boa tarde, criei uma aplicação web que funciona perfeitamente quando rodo localmente pelo Visual Studio, no entanto, quando tentei posta-la na hospedagem uol host, ela me retorna o seguinte erro.

 

Já tentei tudo que eu sabia, pesquisei, mas infelizmente não consigo resolver. Estou praticamente desesperada.

 

Segue o erro:

 

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:

 

 

Line 18: SqlConnection Conecta = new SqlConnection(ConfigurationManager.ConnectionStrings["Conexao"].ConnectionString);

Line 19: SqlDataAdapter da = new SqlDataAdapter(strSelect, Conecta);

Line 20: da.Fill(dt);

Line 21: Conecta.Close();

Line 22: return dt;

 

Source File: e:\home\luaradegan\web\App_Code\functions.cs Line: 20

 

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) +5050218

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234

System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341

System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129

System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +270

System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195

System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232

System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5063943

System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33

System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524

System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479

System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108

System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126

System.Data.SqlClient.SqlConnection.Open() +125

System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +123

System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +166

System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115

conexao.ClasseA.Metodo_dtable(String strSelect) in e:\home\luaradegan\web\App_Code\functions.cs:20

index.Page_Load(Object sender, EventArgs e) in e:\home\luaradegan\web\index.aspx.cs:52

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14

System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35

System.Web.UI.Control.OnLoad(EventArgs e) +91

System.Web.UI.Control.LoadRecursive() +74

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não está conseguindo conectar no SQL.

 

O site está tentando acessar o SQL correto?

 

Posta sua ConnectionString do webconfig pra ver se os dados do Banco estão corretos!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Segue a connectionstring:

 

<add name="Conexao" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=luaradegan\Web\App_Data\ASPNETDB.mdf;Integrated Security=True;Persist Security Info=True;User Instance=True"></add>

 

Brigada pela atenção!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.