New Error , Invalid value for key 'attachdbfilename'.

Discussion in 'ASP.NET / ASP.NET Core' started by Digi_Center, May 4, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi to all

    I've a new messege error :

    Server Error in '/' Application.


    Invalid value for key 'attachdbfilename'.
    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.ArgumentException: Invalid value for key 'attachdbfilename'.

    Source Error:






    Code:
    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:






    Code:
    [ArgumentException: Invalid value for key 'attachdbfilename'.]
       System.Data.SqlClient.SqlConnectionString.VerifyLocalHostAndFixup(String& host, Boolean enforceLocalHost, Boolean fixup) +910371
       System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +915651
       System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
       System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +125
       System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +56
       System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
       System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +138
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
       System.Web.UI.WebControls.GridView.DataBind() +4
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +50
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041
    




    Version Information:Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434




    The Web.config







    <!--


    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>


    <appSettings/>


    <connectionStrings>


    <remove name="Khadija SchoolConnectionString"/>


    <add name="Khadija SchoolConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Khadija School.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"


    providerName="System.Data.SqlClient" />


    </connectionStrings>


    <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.


    -->








    <roleManager enabled="false" />


    <compilation debug="true">





    </compilation>


    <!--


    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>


    -->


    <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">


    <providers>


    <add name="XmlSiteMapProvider"


    description="Default SiteMap provider."


    type="System.Web.XmlSiteMapProvider"


    siteMapFile="web.sitemap"


    securityTrimmingEnabled="true" />


    </providers>


    </siteMap>


    </system.web>


    </configuration><!--
    [ArgumentException]: Invalid value for key 'attachdbfilename'.
    at System.Data.SqlClient.SqlConnectionString.VerifyLocalHostAndFixup(String& host, Boolean enforceLocalHost, Boolean fixup)
    at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
    at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
    at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value)
    at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
    at System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
    at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
    at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
    at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
    at System.Web.UI.WebControls.GridView.DataBind()
    at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
    at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
    at System.Web.UI.Control.EnsureChildControls()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown.
    at System.Web.UI.Page.HandleError(Exception e)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\0324d01f\a8f869f1\App_Web_35wlysw9.0.cs:line 0
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
     
  2. The server does not support dynamic attachment of MDF files. You'll have to use a full SQL 2005 database in your application. Go to the MS SQL 2005 page of your control panel to order SQL 2005 databases. You will then be able to attach (copy) your MDF file to the SQL 2005 database.

    A sample connection string can also be found in the control panel MS SQL 2005 page after you've activated one.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page