Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VIsual Studio 2005 asp.net configuration

Posted on 2006-11-07
14
Medium Priority
?
367 Views
Last Modified: 2012-06-27
Hi,

I am trying to use the asp.net configuration tool in visual studio 2005 but when I click the security tab,  I am unable to see the same selections and Miscrosoft shows at their site.  Could anyon etell me if there is something I  need to check on my system to make this work.  The OS i am using is windows xp pro.  I need to use it to set up roles etc. as all the examples says that is what I need to use but I keep getting the following when i click on the security tab;
I even re installed VS2005 to see if it will correct the problem but no luck.

"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: Unable to connect to SQL Server database. "
0
Comment
Question by:krbnldy
  • 7
  • 7
14 Comments
 
LVL 9

Expert Comment

by:kraffay
ID: 17892320
Make sure you have the following keys in your web config:
<configuration>
      <connectionStrings>
            <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"/>
      </connectionStrings>
<system.web>
<profile>
                  <providers>
                        <add name="AspNetSqlProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSQLServer" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Encrypted"/>
                  </providers>
</profile>
</system.web>
</configuration>

----------------------------------------------------------------------------------------------------------------------------------

This will point your membership data store to the default aspnetdb.mdf in the app_data folder.
0
 

Author Comment

by:krbnldy
ID: 17892417
When I added the code on the web.congif  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 entry 'LocalSqlServer' has already been added. (C:\Inetpub\wwwroot\CustomerMaster\web.config line 14)
0
 
LVL 9

Expert Comment

by:kraffay
ID: 17892940
The LocalSQLServer connection string is being added by the machine.config.  To get around this, add a remove node:

<connectionStrings>
 <remove name="LocalSQLServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"/>
</connectionStrings>


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:krbnldy
ID: 17897728
I made the changes you suggested and i get the following

"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: Unable to connect to SQL Server database."

I h ave never been able to access the optiions under the security tab that allow me to define roles as indicated on all the microsoft and other sites.  I am new to this and have no idea which way to proceed since I need to create a website that has roles for users.

0
 
LVL 9

Expert Comment

by:kraffay
ID: 17897970
Can you post your web.config?
0
 

Author Comment

by:krbnldy
ID: 17898277
here is my web.config

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

  <connectionStrings>
 <remove name="LocalSQLServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"/>
</connectionStrings>
  <system.web>
    <profile>
      <providers>
        <add name="AspNetSqlProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             connectionStringName="LocalSQLServer"
             enablePasswordRetrieval="true"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             applicationName="/"
             requiresUniqueEmail="false"
             passwordFormat="Encrypted"/>
      </providers>
    </profile>

 
        <compilation debug="false" strict="false" explicit="true" />
        <pages>
            <namespaces>
                <clear />
                <add namespace="System" />
                <add namespace="System.Collections" />
                <add namespace="System.Collections.Specialized" />
                <add namespace="System.Configuration" />
                <add namespace="System.Text" />
                <add namespace="System.Text.RegularExpressions" />
                <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>
        </pages>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows" />
        <!--
            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>
        -->
    </system.web>
</configuration>

0
 
LVL 9

Expert Comment

by:kraffay
ID: 17899842
I was able to do the following:

1. Created a new Web Site in Visual Studio 2005
2. Pasted your web.config code
3. Clicked "Website/ASP.NET Cpnfiguration" from VS2005 menu.
4. This opened the ASP.Net Web Application Administration Site.  The Users panel had this message:

The current authentication type is Windows. User management from within this tool is therefore disabled.

5.  I changed the web.config authentication mode to forms:
    <authentication mode="Forms" >
      <forms loginUrl="login.aspx"/>
    </authentication>

6. The Users panel now shows:

Existing users: 0

7. From here on, I should be able to add roles and users.  

If you can't get this to work, create a new web site from scratch.  Without any changes, you should be able to follow the steps I did above and get security to work.
0
 

Author Comment

by:krbnldy
ID: 17900102
i tried following the above  and got the same error.   Are there permission issues I could have on my box,  I work on a LAN.  I have tried everything so I am beggining to think it is a permissions issue on my box.  Is there anything I can check.

0
 
LVL 9

Expert Comment

by:kraffay
ID: 17900173
Do you have local Admin rights?
0
 

Author Comment

by:krbnldy
ID: 17900831
it shows that i do
0
 
LVL 9

Expert Comment

by:kraffay
ID: 17901026
Do you SQLServer 2005 or SQLServer Express installed?  And do you see a aspnetdb.mdf file in your app_data folder?
0
 

Author Comment

by:krbnldy
ID: 17901461
my app_data folder does not have any files in it and No I do not have SQL server 2005 or express installed.    By the way is MS SQL server 2005 ctp the same as sql server 2005,  
MS SQL server 2005 ctp  is installed and has one tab - Configuration Tools that contains- configuration manager and SQL server surfacearea configuration.   I am not familiar with any of those.   Please let me know what i have to install, run or enable.

Thank you for your assistance.

0
 
LVL 9

Accepted Solution

by:
kraffay earned 400 total points
ID: 17901628
The CTP is a beta.

I would download SQL-Server Express

http://msdn2.microsoft.com/en-us/sql/aa336346.aspx

That will create an instance of .\SQLServer database, which is what you need for security.
0
 

Author Comment

by:krbnldy
ID: 17905733
Thank you,

I downloaded sql server 2005 express and now it works fine.  Your help is greatly appreciated.   Now let me work and making my first authenticated user website.  Wish me luck.

Thank again
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Loops Section Overview

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question