Я купил Windows "Окончательный общий хостинг" от Godaddy. Я загрузил все необходимые файлы, сайт работает. Когда я создал базу данных на myLittleAdmin и получил от нее строку подключения. Я поместил эту строку подключения в мой файл web.config, который размещен на godaddy, но выдает ошибку всякий раз, когда я отправляю запрос в базу данных с размещенного сайта. Строка работает на localhost отлично.
Я просто не знаю, где я поступил неправильно.
Это строка подключения:
<connectionStrings>
<add name="GodaddyString" connectionString="Data Source=IP;Initial Catalog=db108;Integrated Security=False;User ID=USER;Password=PASS"
providerName="System.Data.SqlClient" />
</connectionStrings>
Это файл Web.config:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application,
please visit
https://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="GodaddyString" connectionString="Data
Source=IP;Initial Catalog=db108;Integrated
Security=False;User ID=USER;Password=PASSWORD"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<trust level="Full" />
<compilation targetFramework="4.6.1" defaultLanguage="c#" />
<httpRuntime targetFramework="4.6.1" />
<urlMappings enabled="true">
<add url="~/home" mappedUrl="~/index.aspx" />
<add url="~/ourstory" mappedUrl="~/ourstory.aspx" />
<add url="~/anual_report" mappedUrl="~/anual_report.aspx" />
<add url="~/education" mappedUrl="~/education.aspx" />
<add url="~/error" mappedUrl="~/error.aspx" />
<add url="~/healthcare" mappedUrl="~/healthcare.aspx" />
<add url="~/livelihood" mappedUrl="~/livelihood.aspx" />
<add url="~/joinus" mappedUrl="~/joinus.aspx" />
<add url="~/mobile-library_stem-project" mappedUrl="~/mlstem.aspx" />
<add url="~/mission-vision-values" mappedUrl="~/mvv.aspx" />
<add url="~/our_partners" mappedUrl="~/partners.aspx" />
<add url="~/the_team" mappedUrl="~/theteam.aspx" />
<add url="~/our_trustees" mappedUrl="~/trustees.aspx" />
<add url="~/whole_school_transformation" mappedUrl="~/wst.aspx" />
<add url="~/contact-us" mappedUrl="~/contact.aspx" />
<add url="~/volunteer_with_us" mappedUrl="~/volunteers.aspx" />
<add url="~/ayang@news" mappedUrl="~/ayangsnews.aspx" />
<add url="~/our-advisors" mappedUrl="~/advisors.aspx" />
<add url="~/editprofile" mappedUrl="~/editprofile.aspx" />
<add url="~/change-password" mappedUrl="~/chgpassword.aspx" />
<add url="~/change-email" mappedUrl="~/chgemail.aspx" />
<add url="~/edit-user" mappedUrl="~/edituser.aspx" />
<add url="~/delete-user" mappedUrl="~/deluser.aspx" />
<add url="~/register-user" mappedUrl="~/adduser.aspx" />
<add url="~/gallery" mappedUrl="~/gallery.aspx" />
<add url="~/Gallery/hummingbird-school-picture_viewer" mappedUrl="~/Gallery/gallerypart1.aspx" />
<add url="~/Gallery/whole-school-transformation-picture_viewer" mappedUrl="~/Gallery/gallerypart2.aspx" />
<add url="~/Gallery/library-program-picture_viewer" mappedUrl="~/Gallery/gallerypart3.aspx" />
<add url="~/Gallery/video-album_player" mappedUrl="~/Gallery/gallerypartvideo.aspx" />
<add url="~/ayang_manthan_fellowship" mappedUrl="~/manthanedufellow.aspx" />
<add url="~/newsletter" mappedUrl="~/newsletter.aspx" />
<add url="~/newsletterdel" mappedUrl="~/newsletterdel.aspx" />
<add url="~/userdashboard" mappedUrl="~/userdashboard.aspx" />
<add url="~/usereditprofile" mappedUrl="~/usereditprofile.aspx" />
<add url="~/useremailedit" mappedUrl="~/useremailedit.aspx" />
<add url="~/dashboard" mappedUrl="~/dashboard.aspx" />
<add url="~/usereditpassword" mappedUrl="~/usereditpassword.aspx" />
<add url="~/blogedit" mappedUrl="~/userblogedit.aspx" />
</urlMappings>
<customErrors mode="Off" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<system.net>
<mailSettings>
<smtp>
<network host="relay-hosting.secureserver.net" port="25" />
</smtp>
</mailSettings>
</system.net>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
</system.codedom>
</configuration>
Эта ошибка появляется при отправке запроса с размещенного сайта:
Ошибка сервера в приложении '/'.
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.SqlException: произошла ошибка, связанная с сетью или экземпляром, при установлении соединения с SQL Server. Сервер не найден или не был доступен. Убедитесь, что имя экземпляра указано правильно и что SQL Server настроен для разрешения удаленных подключений. (поставщик: сетевые интерфейсы SQL, ошибка: 26 - ошибка при поиске сервера / указан экземпляр)
Ошибка источника:
Во время выполнения текущего веб-запроса было сгенерировано необработанное исключение. Информацию о происхождении и местонахождении исключения можно определить с помощью приведенной ниже трассировки стека исключений.
Трассировка стека:
[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.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager) +907
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +334
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +38
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +699
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +89
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +426
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 oldConnection, DbConnectionInternal& connection) +191
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +154
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +21
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +90
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +443
System.Data.SqlClient.SqlConnection.Open() +96
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +120
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +160
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +108
Ayang_Final_Website.login.Login_button_Click(Object sender, EventArgs e) in C:\Users\Jaevein\Desktop\website\Ayang Final Website\Ayang Final Website\login.aspx.cs:39
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9782698
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3394.0