locked
Need help locating and connecting to database RRS feed

  • Question

  • User931778073 posted

     Hello All,

    I have been trying to connect to my database which I have created in SQL Server Management Studio for about a week now . I thought the answer to my last post had solved my problem but it didn't so I'm here to bug you guys again.  I don't know what I did wrong so I will describe what I did then perhaps you could tell me what I did wrong and suggest to me what I should do. The following are what I did.

    1) Connect to Server ( Server Type: Database Engine, Server Name: Server1, Authentication: Windows)
    2) Once inside of SSMS select Object Explorer, select instance of sql 2005 and expand it.
    3) Right-click Databases, and then click New Database.
    4) Give database a name, create the database by accepting all default values, click OK.


    I can see the database which I have named FirstDb.  I can also see all the tables in it so I assumed everything is as it should be. Then I ran aspnet_regsql, create a webpage and tweak its Web.config file to point to FirstDb. Then I go through the usual steps of creating user roles and account and try to use the Login Control. To my surprise I did not see FirstDb in the Server Explorer window in Visual studio. If access rights is the cause of the problem how to I go about finding out what my user account can or cannot access? Please help me out with this problem, thank you in advance for your time.
     

    Thursday, August 7, 2008 7:25 PM

Answers

  • User-1705717250 posted

    When you say tweak web.config does this mean that you have defined membership and connectionString.

    Heres a simple sample web.config that show you how the membership should be setup.

     

    <?xml version="1.0" encoding="UTF-8"?>
    
    <configuration>
    
     <connectionStrings>
        <remove name="LocalSqlServer" />
    <!--You add your connectionstring here-->
    
    </connectionStrings>
      
       <system.web>
    <!--set if you are using roles-->
         <roleManager enabled="true" />
    
         <authentication mode="Forms">
            <forms timeout="50000000"/>
          </authentication>
    
    <!--set if you are using membership-->
    <!-- You should ALWAYS customize the Membership provider and specify an applicationName... 
    see http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx 
    for more details... -->
     <membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">
                <providers>
                    <clear/>
                    <add name="AspNetSqlMembershipProvider"
                        type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                        connectionStringName="LocalSqlServer"
                        enablePasswordRetrieval="false"
                        enablePasswordReset="true"
                        requiresQuestionAndAnswer="true"
                        requiresUniqueEmail="false"
                        passwordFormat="Hashed"
                        maxInvalidPasswordAttempts="5"
                        minRequiredPasswordLength="7"
                        minRequiredNonalphanumericCharacters="1"
                        passwordAttemptWindow="10"
                        passwordStrengthRegularExpression="" 
                        applicationName="/" 
                    />
                </providers>
     </membership>
    
    
    </system.web>
    </configuration>
     Hope it helps
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 8, 2008 4:50 AM