locked
Access DB connection does not work. RRS feed

  • Question

  • User-1243272925 posted

    Hi Guys,

                 I have got a small website with MS Access Database.  I have used access membership provide with it.  i bought hosting with Discountasp.net when i uplaoded my web to the server it gives me following error. It works perfect on my local machine.  i have contacted the support guys they say there is somthing worng with my web config there is nothing pointing to sql server in my web config.  here is my error message.  I have a hosting with iis 6 it does work on that but it does not with with iis7.   Can anyone please help.  Thanks in advance.


    Server Error in '/' Application.

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

    Source Error:

    Line 158:        <roleManager>
    Line 159: <providers>
    Line 160: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    Line 161: <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    Line 162: </providers>

    Source File: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config    Line: 160


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


    Regards,

    Lahorya

    Friday, May 14, 2010 7:16 PM

Answers

  • User-2080168305 posted

    pls refer these 2 post. u get ur answer from there.

    http://forums.asp.net/t/1163491.aspx
    http://forums.asp.net/t/1489027.aspx


    i hope it help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 15, 2010 2:01 AM
  • User-1199946673 posted

    Well, I think the error is quit clear!

    "The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty"

    Both the membershipprovider and roleprovider (and others) are using by default the LocalSqlServer Connectionsstring which is specified in the connectionstrings section of web.config. But in your web.config, you'll not see it there. So when you upload it to your hosting company, you'll get this error. That it does work on your local machine is because the LocalSqlServer Connectionstring is in your machine.config file.

    You say you're using the Access Membership provider. If you don't want to use the role provider, simply remove the rolemanager section completly. When you don want to use the (Access) Role Provider, you need to remove line 160 and add a new entry pointing to the right connectionstring (the same that you used for the membership provider), but also set the other properties so that they point to your Access Role Provider....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 15, 2010 8:44 AM

All replies

  • User-2080168305 posted

    pls refer these 2 post. u get ur answer from there.

    http://forums.asp.net/t/1163491.aspx
    http://forums.asp.net/t/1489027.aspx


    i hope it help

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 15, 2010 2:01 AM
  • User-1199946673 posted

    Well, I think the error is quit clear!

    "The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty"

    Both the membershipprovider and roleprovider (and others) are using by default the LocalSqlServer Connectionsstring which is specified in the connectionstrings section of web.config. But in your web.config, you'll not see it there. So when you upload it to your hosting company, you'll get this error. That it does work on your local machine is because the LocalSqlServer Connectionstring is in your machine.config file.

    You say you're using the Access Membership provider. If you don't want to use the role provider, simply remove the rolemanager section completly. When you don want to use the (Access) Role Provider, you need to remove line 160 and add a new entry pointing to the right connectionstring (the same that you used for the membership provider), but also set the other properties so that they point to your Access Role Provider....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 15, 2010 8:44 AM