Publishing my SQL database

Discussion in 'Databases' started by winhoau, Jan 22, 2013.

  1. Hello Guys,

    After reading some additional posts I begin to conclude that I didn't really need to publish my SQL database to Winhost using the sql script. I went into it because of the error message which I got when I tried to login to my site. (pasted below) after uploading my .bak files, restoring them and making a connection string to the site on IIS. If this is the case, can some one advise on what might be amiss looking at the error message pasted below;

    Server Error in '/' Application.

    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) +5064458
    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) +5078107
    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.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +95
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +206
    System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +827
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +106
    System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +129
    System.Web.UI.WebControls.Login.AttemptLogin() +127
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
    System.Web.UI.WebControls.Button.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) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

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


    Thanks in advance.
     
    Last edited by a moderator: Oct 14, 2015
  2. Re-publishing sql to Winhost server

    Following my post on Error 26 instance was not found(by the way , the header of my post should have been 'publishing my MS SQL to Winhost server' and not my SQL', Winhost staff Rel kindly advised that my website was trying to connect to my local sql Express database. I promptly deleted the copy of ASPNETDB that was uploaded .I tried to log thereafter and I now have a new error message stating that the SSE provider did not find the database specified in my connection string and could not automatically create the database files at a lower trust level. See the full message pasted below;

    Server Error in '/' Application.
    ________________________________________
    The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.
    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.Configuration.Provider.ProviderException: The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.

    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:

    [ProviderException: The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.]
    System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile(String connectionString) +2938025
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +98
    System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +827
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +106
    System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +129
    System.Web.UI.WebControls.Login.AttemptLogin() +127
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
    System.Web.UI.WebControls.Button.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) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

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


    I need to change the trust level of my database, or create a DSN connection string. I would welcome more informed suggestions on the issue.
     
    Last edited by a moderator: Oct 14, 2015
  3. Re-publishing sql to Winhost server

    Hello,

    Can a Winhost Staff assist in changing the trust level of my Database. The level for the whole site shows Full(internal) but that of my application Data Folder shows that it is locked and cannot be set by me.

    Cheers.
     
    Last edited by a moderator: Oct 14, 2015
  4. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015
  5. publishing my MS SQL DB to Winhost Server

    Thanks for your response,

    I have followed the steps enumerated. Just one step that wasn't done because I kept getting the error message from the command line that the file is not found when I tried to generate Cache Dependencies.

    Any workarround this?

    Also, there is no insertion of user data into the SQL database tables. I only get data insertion into the ASPNETDB file. Do I need to do open connection ?

    Thanks for your response.
     
  6. Elshadriel

    Elshadriel Winhost Staff

    You need to enable Service Broker to use SQL Cache Dependency.

    If records are not being INSERTED into your table, make sure you connection string in your web.config file/code is correct. Here are instructions on how to find the MS SQL connection string information to your database:

    1) Log into the Winhost Control Panel at https://cp.Winhost.com
    2) Click on the Sites tab.
    3) Click on the Manage link next to the site you want to manage.
    4) Click on the MS SQL Manager button.
    5) Click on the Manage link next to the database you want to manage.

    The connection string information will appear at the bottom. Please remember to replace the ****** in the password section with your actual database password which is initially set to be the same as your site password. If you have forgotten it, use the Edit link next to Database Password to change it.
     
    Last edited by a moderator: Oct 14, 2015

Share This Page