Web site does not allow same user/role access as when testing locally

Discussion in 'Databases' started by Tonyg, Mar 20, 2008.

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

    Using VS2005, Pro, SP1, .NET Framework 2.0, ASP.NET 2.0, AJAX, WSE 3.0.

    When i test my web site locally, there is a link that only a user with an Administrators role can use. It works fine. When i upload my site to discountASP.NET, the same web site does not allow the same link to be accesssed by the same user with the same Administrators role. I can login OK, but it won't allow me to use the link.

    There is no error, it just does nothing.

    I deleted my database and tried to follow the steps in Q10413 at the direction of tech support. After step 6. In the Web Site Administration tool, go to the Security tab, i get the following error:

    "There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
    The following message may help in diagnosing the problem: The connection name 'CoyneWebDatabaseConnectionString' was not found in the applications configuration or the connection string is empty. (C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\CoyneWebServices\web.config line 81)"

    Here is what is on line 81 of my web.config:



    type="System.Web.Security.SqlMembershipProvider"


    How do i get this thing to work?


    Any help would be gratefully appreciated.


    Thanks,
    Tony
     
  2. Hi Tony,
    Can you post the Connection strings section of that web.config?
    (Comment out any sensitive parts, i.e passwords)
    Salute,
    Mark
     
  3. Hello Mark.


    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=sql2k509.discountasp.net;Integrated Security=false;Initial Catalog=SQL2005_392200_coynedb;User ID=SQL2005_392200_coynedb_user;Password=xxxxxxx" providerName="System.Data.SqlClient" />
    Thanks for your help.
    Tony
     
  4. I'm not sure if the integrated securities may be the problem there so please try it like this:

    <connectionStrings>
    <clear/>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=sql2k509.discountasp.net;Initial Catalog=SQL2005_392200_coynedb;User ID=SQL2005_392200_coynedb_user;Password=xxxxxxx;" providerName="System.Data.SqlClient"/>
    </connectionStrings>


    *Notice the Close after Password: ";"
     
  5. Hello Mark.


    I get the same error.


    Thanks,
    Tony
     
  6. I don't really have a handle on what you are creating...Is it a starter kit?
    Seems this may be a role problem but I'm guessing. [​IMG]
     
  7. Mark,

    >>I don't really have a handle on what you are creating...Is it a starter kit?<<

    I'm not sure of what you are asking. I'm not creating anything. It's already created and it works locally. I'm simply trying to make it work the same way on discountAsp.Net as it does when i am testing.

    It's not a starter kit. It's my web site.

    Thanks,
    Tony
     
  8. Bruce

    Bruce DiscountASP.NET Staff

    This error means that your application is trying to use a connection string named: "CoyneWebDatabaseConnectionString" but it is not defined inyour web.config.


    Check the web.config and make sure the connection string is there.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  9. Hello Bruce.


    OK. I created another connection string with that name. Now my connection string section looks like this:
    <clear/>
    <add name="CoyneWebDatabaseConnectionString" connectionString="Data Source=sql2k509.discountasp.net;Initial Catalog=SQL2005_392200_coynedb;User ID=SQL2005_392200_coynedb_user;Password=xxxxxxx"/>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=sql2k509.discountasp.net;Integrated Security=false;Initial Catalog=SQL2005_392200_coynedb;User ID=SQL2005_392200_coynedb_user;Password=xxxxxxx" providerName="System.Data.SqlClient" />

    And that did allow me to finish the rest of Q10413. However, where is my database? It's not in the APP_DATA folder nor in C:\Program Files\Microsoft SQL Server\MSSQL\Data, C:\Program Files\Microsoft SQL Server\MSSQL$MICROSOFTSMLBIZ\Data, C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data or C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\App_Data.

    I will do a search of my hard drive.

    If this is the correct way to do this, then is Q10413 wrong or incomplete? Since, i cannot find my database, i have to assume Q10413 is not related to the problem i am trying to resolve or maybe the additional connection string i put in my web.config is not correct. I have no idea.

    Is everythinga web siteneeds for users, roles and rules contained in the SQL database?

    Thanks,
    Tony
     
  10. Hello.


    Did i do the connection string wrong asmy lastreplyindicated?


    I'm still working on this problem.


    Thanks,
    Tony
     
  11. Hi Tony,
    Try it exactly like this, just replace your password:

    <connectionStrings>
    <clear/>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k509.discountasp.net;Initial Catalog=SQL2005_392200_coynedb;User ID=SQL2005_392200_coynedb_user;Password=xxxxxxx;" providerName="System.Data.SqlClient"/>
    <remove name="CoyneWebDatabaseConnectionString"/>
    <add name="CoyneWebDatabaseConnectionString" connectionString="Data Source=tcp:sql2k509.discountasp.net;Initial Catalog=SQL2005_392200_coynedb;User ID=SQL2005_392200_coynedb_user;Password=xxxxxxx;" providerName="System.Data.SqlClient"/>
    </connectionStrings>
     
  12. Yippee ! ! ! That did it.

    Now the web site works the same as my testing environment. Thank you very much.

    I noticed that the Data Source name has a "tcp:" in the value. Can you tell me what that does? It was not included in my other connection strings.

    Thanks again.
    Tony
     
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