Connection problem

Discussion in 'Databases' started by Recency, Feb 5, 2010.

  1. Hello:
    I am getting the follow error:
    The user instance login flag is not supported on this version of SQL Server. The connection will be closed.

    I am using 2008 server sql. Does any on know how I can fix this?

    Recency
     
  2. Ray

    Ray

    Can you give us the full and exact error message? Where are you seeing this error message at? Are you seeing it in your SSMS or your web page hosted on our server?
     
  3. The messages are appearing on your server. The webpage displays but the login controls and so admit errors.
    My homepage is
    http://www.homemadeartdrawings.com

    This is the message that I am recieving now:
    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
    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.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

    Source Error:

    The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

    <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
    <system.web>
    <compilation debug="true"/>
    </system.web>
    </configuration>

    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

    Stack Trace:


    [HttpException (0x80004005): Unable to validate data.]
    System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +289
    System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +140

    [ViewStateException: Invalid viewstate.
    Client IP: 141.151.163.120
    Port: 2738
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.590; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSN Optimized;US; Creative AutoUpdate v1.40.01)
    ViewState: /wEPDwULLTEzODM1NzY0OTIPZBYCZg9kFgICAw9kFgYCDQ9kFgJmD2QWAgIBD2QWAmYPZBYCAg0PEA8WAh4HQ2hlY2tlZGhkZGRkAhMPDxYCHgRUZXh0BQE0ZGQCFQ8PFgIfAQUBNGRkGAMFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYNBR9jdGwwMCRpbWdCdG5Ib21lbWFkZUFydERyYXdpbmdzBSJjdGwwMCRMb2dpblZpZXcxJExvZ2luMiRSZW1lbWJlck1lBVZjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJENyZWF0ZVVzZXJXaXphcmQxJF9fQ3VzdG9tTmF2MCRTdGVwUHJldmlvdXNCdXR0b25JbWFnZUJ1dHRvbgVSY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRDcmVhdGVVc2VyV2l6YXJkMSRfX0N1c3RvbU5hdjAkU3RlcE5leHRCdXR0b25JbWFnZUJ1dHRvbgVQY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRDcmVhdGVVc2VyV2l6YXJkMSRfX0N1c3RvbU5hdjAkQ2FuY2VsQnV0dG9uSW1hZ2VCdXR0b24FY2N0bDAwJENvbnRlbnR...]

    [HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
    System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106
    System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
    System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +242
    System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
    System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
    System.Web.UI.HiddenFieldPageStatePersister.Load() +207
    System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105
    System.Web.UI.Page.LoadAllState() +43
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
    System.Web.UI.Page.ProcessRequest() +80
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
    System.Web.UI.Page.ProcessRequest(HttpContext context) +49
    ASP.registerpage_aspx.ProcessRequest(HttpContext context) +37
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


    When I add the debug to the webcofig, I get this following error:
    Error Summary
    HTTP Error 500.19 - Internal Server Error
    The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error InformationModule IIS Web Core
    Notification Unknown
    Handler Not yet determined
    Error Code 0x800700b7
    Config Error Config section 'system.web/compilation' already defined. Sections must only appear once per config file. See the help topic <location> for exceptions
    Config File \\?\E:\web\homemad1\web.config
    Requested URL http://www.homemadeartdrawings.com:80/RegisterPage.aspx
    Physical Path
    Logon Method Not yet determined
    Logon User Not yet determined
    Config Source
    102: </httpModules>
    103: <compilation debug="true"/>
    104: </system.web>
     
  4. Ray

    Ray

    Your application pool is being recycled. There are some conditions setup on the web servers so that no single application consumes all of the servers resources such as CPU and Memory.

    1) More than 20 minutes of idle time (no http request in 20 minutes)
    2) The application uses more than 100 MB memory for Basic plan 200 MB for Max plan.
    3) The application uses more than 75% of CPU time

    If you do not need viewstate, I suggest you disable it by seeing viewstate to False on your .Net application.

    If you want to find out what condition your application is hitting, I suggest you open a ticket to our support department and they can check the event log for any recycle entries for your application pool.

    Bear in mind that the event log does not record the specific reason why the application pool is being recycled only the condition it reached. If you need to find out what module, component, or assembly is hitting these thresholds, you will need to test it on your development box and incorporate these same conditions we have on our servers.
     
  5. Currently, I am getting this error on you server when ever I try using the login controls:

    The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
    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: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.

    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): The user instance login flag is not supported on this version of SQL Server. The connection will be closed.]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849719
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4864151
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
    System.Data.SqlClient.SqlConnection.Open() +122
    System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221
    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) +815
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78
    System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119
    System.Web.UI.WebControls.Login.AttemptLogin() +115
    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) +118
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
    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) +1565
     
  6. my ills version is 5.0 maybe that is the reason?
     
  7. How do I disable veiwstate? Where would I find the viewstate?
     
  8. Ray

    Ray

    To disable viewstate, go to your applications web.config file and look for this line.

    <Pages EnableViewState="false"/>

    I'm not completely certain the SQL connection error you are getting maybe related to your viewstate problem.

    Can you give us a copy of your connection string?
     
  9. The following is my whole web config:

    <?xml version="1.0"?>
    <!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration>
    <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    </sectionGroup>
    </sectionGroup>
    </sectionGroup>
    </configSections>
    <appSettings/>


    <system.web>
    <!--
    Set compilation debug="true" to insert debugging
    symbols into the compiled page. Because this
    affects performance, set this value to true only
    during development.

    Visual Basic options:
    Set strict="true" to disallow all data type conversions
    where data loss can occur.
    Set explicit="true" to force declaration of all variables.
    -->
    <roleManager enabled="true" />
    <compilation debug="true" strict="false" explicit="true">
    <assemblies>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
    </compilation>

    <pages>
    <namespaces>
    <clear/>
    <add namespace="System"/>
    <add namespace="System.Collections"/>
    <add namespace="System.Collections.Generic"/>
    <add namespace="System.Collections.Specialized"/>
    <add namespace="System.Configuration"/>
    <add namespace="System.Text"/>
    <add namespace="System.Text.RegularExpressions"/>
    <add namespace="System.Linq"/>
    <add namespace="System.Xml.Linq"/>
    <add namespace="System.Web"/>
    <add namespace="System.Web.Caching"/>
    <add namespace="System.Web.SessionState"/>
    <add namespace="System.Web.Security"/>
    <add namespace="System.Web.Profile"/>
    <add namespace="System.Web.UI"/>
    <add namespace="System.Web.UI.WebControls"/>
    <add namespace="System.Web.UI.WebControls.WebParts"/>
    <add namespace="System.Web.UI.HtmlControls"/>
    </namespaces>
    <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>
    </pages>
    <!--
    The <authentication> section enables configuration
    of the security authentication mode used by
    ASP.NET to identify an incoming user.
    -->
    <authentication mode="Forms"/>

    <!--
    The <customErrors> section enables configuration
    of what to do if/when an unhandled error occurs
    during the execution of a request. Specifically,
    it enables developers to configure html error pages
    to be displayed in place of a error stack trace.

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
    <error statusCode="403" redirect="NoAccess.htm" />
    <error statusCode="404" redirect="FileNotFound.htm" />
    </customErrors>
    -->
    <httpHandlers>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    </httpHandlers>
    <httpModules>
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </httpModules>

    </system.web>

    <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer"
    connectionString="Data Source=tcp:s02.Winhost.com;Initial Catalog=DB_3684_aspnetdb;User ID=DB_3684_aspnetdb_user;Password=********;Integrated Security=False; User Instance=true"
    providerName="System.Data.SqlClient"/>
    </connectionStrings>


    <system.codedom>
    <compilers>
    <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="WarnAsError" value="false"/>
    </compiler>
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="OptionInfer" value="true"/>
    <providerOption name="WarnAsError" value="false"/>
    </compiler>
    </compilers>
    </system.codedom>
    <!--
    The system.webServer section is required for running ASP.NET AJAX under Internet
    Information Services 7.0. It is not necessary for previous version of IIS.
    -->
    <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
    <remove name="ScriptModule"/>
    <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
    <remove name="WebServiceHandlerFactory-Integrated"/>
    <remove name="ScriptHandlerFactory"/>
    <remove name="ScriptHandlerFactoryAppServices"/>
    <remove name="ScriptResource"/>
    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </handlers>
    </system.webServer>
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
    </assemblyBinding>
    </runtime>
    </configuration>


    I tried inserting the viewstate but the webconfig diddn't like it.
     
    Last edited by a moderator: Oct 14, 2015
  10. Ray

    Ray

    The viewstate element should be under the system.web element. Try looking at this link.

    http://msdn.microsoft.com/en-us/library/950xf363.aspx

    Bear in mind that it is case sensitive so you'll have to be careful with what you type.

    If you want a more graphical way of disabling viewstate try using the IIS 7 manager. Use this kb article for some guidelines on how to download, and setup IIS 7 manager to connect to our server.

    http://support.Winhost.com/KB/a628/using-the-microsoft-iis-70-manager.aspx

    Once you're connected click on the module (button) "Pages and Controls".

    Click on the plus sign '+' next to the text ViewState". Once expanded you can set "Enable View State" to False, and click on Apply to set the changes.

    Remember, each web application may have its own web.config file. So you'll need to navigate to the subfolder of the application you are targeting and set the changes on that web.config file.
     
    Last edited by a moderator: Oct 14, 2015
  11. same symptom - different problem + solution

    hi I had the same symptom or error message.

    in my case this was the cause:

    - I decided to move out all my database code (with .dbml models) into a separate assembly

    - in the new assembly, 'DatabaseLibrary.dll', there was code that attempted to connect to the database, without specifying the connection string. stuff like this:

    using(AspAccountDataContext ctx = new AspAccountDataContext())
    {
    ....
    }

    This code was trying to take its connection string from the config file for the assembly: 'DatabaseLibrary.dll.config'. However this config file did not exist on the web site, because I forgot to deploy this config file ( the Publish feature does not seem to pick up config files of sub-assemblies).

    So the code tried to connect to the 'default' database setting which is in the .dbml file, which was something like '/SQLEXPRESS;' - my local database instance !

    The solution I went for was to deploy the missing .config file, AND to change the default connection string to point to the web site SQL Server instance.

    This resolved the error message.

    BTW you have a password in the clear up there you might want to change it :)
     
  12. Thanks for posting your solution.

    Done. It looked like a local dev password, but I took it out anyway.
     

Share This Page