Answered Web Site Admin Tool problem in VS2005

  • Friday, October 14, 2005 7:51 PM
     
     
    All,

    When I create a new project and try to use the WSAT security tab, 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 am using VS2005 beta2 with a local copy of SQL Server Express.

    I am new to all of this so a little help would be great

    Thx
    jonpfl

All Replies

  • Tuesday, October 25, 2005 6:18 PM
     
     
    I got EXACTLY the same problem.

    @ jonpfl: did you find out how to fix that probelm?

    pls help

    cheers
  • Tuesday, October 25, 2005 6:35 PM
     
     
    Nope, never did figure it out since I had to work on something else and have not had a chance to go back and look into it.

    If you figure it out, please let me know : jonp@NOSPAMtampabay.rr.com

    Thx
    jonpfl
  • Saturday, December 03, 2005 12:31 PM
     
     
    I also have the exact same problem. Did any of you manage to solve it?
  • Saturday, December 03, 2005 4:06 PM
     
     
    I just solved the problem. If you still haven't, feel free to contact me.
  • Monday, December 12, 2005 3:18 PM
     
     
    Please tell how you fixed the problem.

    feel free to drop a copy to Sasha _AT_ bolotnov.info
  • Tuesday, December 13, 2005 6:26 PM
     
     
    Also - can you try this on a clean machine with an install of the RTM versions of VS 2005 + Sql Server Express?

    With a new install you should be able to create a file-based website where the services database is automatically created for you.  If things still don't work on the RTM bits:

    1.  Create a page in your app with one line of code:  Membership.CreateUser("foo","baz")

    2.  Run the page

    Then post the stack dump and the error message here.

    Thanks!
  • Friday, January 06, 2006 4:16 PM
     
     

    I had the same error. It was caused by this tag i web.config

    <identity impersonate="true" userName="xxxxxx" password="xxxxx" />

    Remove it or change the username and password to a valid user.

  • Monday, January 30, 2006 7:21 AM
     
     

    Could you please share with me how you solved his issue?

    when I click 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.

    Thanks for looking into it.

  • Tuesday, August 22, 2006 12:51 PM
     
     
    i am responding to you regarding the security tab in web site admin tool. please could you point me to the solution
  • Tuesday, August 22, 2006 5:04 PM
     
     Answered

    hi all,

    this one might interest you

    start>run>control>administrative tools>internet information services

    in the IIS rightclick default website>click on properties> click on asp.net

    in the asp.net click version2> then click edit global configuration.

    take a look at the connection string property for LOCALSQLSERVEr

    its pointing to (.)\SQLEXPRESS

    regards

    joey

     

     

     

     

     

  • Monday, October 23, 2006 5:05 PM
     
     

     Ganesh ,

    did you ever resolve this one?

  • Wednesday, January 17, 2007 2:40 AM
     
     

    This issue sometimes relates to SQL Express not having permissions to access its files on the local machine. You probably accidently changed the permissions on the folders by inheritence.

    Goto:

    Start->Control Panel->Administrative Tools->Event Viewer

    In "Event Viewer (Local)" on the left select "Application". You will then find some errors caused by "MSSQL$SQLEXPRESS" service. The event code (Error code) for these errors are 17204 and 17207. Open these up and they should look something like this:

    17207:

    FCB::Open: Operating system error 5(Access is denied.) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf'. Diagnose and correct the operating system error, and retry the operation.

    17207:

    FCB::Open failed: Could not open file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf for file number 2. OS error: 5(Access is denied.).

    Take note of the folder in this example "C:\Program Files\Microsoft SQL Server". Set permissions on this folder and all its contents to be accessable by the "NT AUTHORITY\NetworkService" or "NETWORK SERVICE" user on your machine. Change permissions at your own risk.

    Alternatively you can try change the user that the SQL Server services run on to the same as your login but not sure if that will work.

     

  • Tuesday, March 20, 2007 1:24 PM
     
     

    Hi

    I've been trying to solve the "There is a problem with your selected data store" error message with no success. My laptop's got Windows XP Home edition and I have enabled the IIS thing (grabbed some files off Win2000 Professional). I got as well VB2005 Express Edition, SQL 2005 Express Edition and of course Web Developer 2005 Express Edition.

    In your post, you suggested that you have solved this problem... Could I ask you how please?

    Many thanks

    Christian

  • Saturday, March 31, 2007 7:33 PM
     
     Answered

    I just resolved this issue for my local machine.

    In the web.config file I changed / added the following:

     

    <connectionStrings>

    <remove name="LocalSqlServer" />

    <add name="LocalSqlServer" connectionString="Integrated Security=SSPI;Data Source=YOURMACHINENAME ;Initial Catalog=aspnetdb;" providerName="System.Data.SqlClient" />

    </connectionStrings>

     

    The problem was the Data Source wich was pointing to .SQLEXPRESS. I just typed in the machine name and everything is ok.

    Please mention that SSPI is integrated security. If you deside to deploy your application you migth want to change this to some anonimous webuser account.

     

    Extra notice;

     

    If you would like to use the admin wizard on an external machine eg. a server make sure u keep the instance at LocalSqlServer.

    The wizard appears to be using this name in hard code.

     

    Arno

  • Wednesday, April 25, 2007 6:12 PM
     
     
    I Have Solved This Problem... THANX JOEY ... You really Helped everyone ..
    anyhow im going to tell a little Detail to readers ....

    This is About Using MS SQL SERVER 2005(Non Express Version) ..... with Rolebased Member ship .....

    1.  First we need to Setup the DATABASE in the MS SQL SERVER 2005 to use for the Role based member ship ....
    Go to Start > Program Files > Visual Studio 2005 > Visual Studio Tools > Visual Studio Command Prompt...
    There just type this Command
    aspnet_regsql.exe
    and press enter...
    It will start a wizard ... in the wizard .. Give your MS SQL SERVER 2005  Instance Name... lets say ...   ASIF\SQL2K5  (Where Asif is my Computer Machine name and then Slash and then SQL2K5 is the SQL Instance name i gave while i was installing MS SQL SERVER 2005 you can also sometime have it like (localhost) Hope it will work for you in your case... in simply this is the DATA SOURCE name what you use in your Connection String usually...) Then you can choose an Existing Database ... lets say ... DB_Existing ... which is already residing in my database Engine ...  But i can also Give the New Name like ASPNET .. it will Upgrade the Previous (if exists) or Create a new DB with TABLES Neccessary to  setup a complete Membership in ASP.Net to use ASP.Net Readymade conrols.... 
    Then press Finish or OKAY whatever ....

    If you will go to the Database you will see that there is a complete setup made by that Wizard you ran ....

    2.  We need to setup this Database for use by the *ASP.Net Website configuration Tool*.
    Go to Control Panel > Administrative Tools > Internet Information Service > Expand to the Default Website.. Right Click on the "WEBSITES" node (which is PARENT Node of the Default Website Node) .. > Properties > ASP.Net > Edit Configuration > Genral Tab >  ConnectionString Manager ...
    SO WE ARE AGAIN HERE .. here you will see that the connection string is WRONG(according to the MS SQL SERVER 2005 .. its setup for MSSQL Express Edition with a default database given named something like ASPNET DB whatever....you JUST NOW Change that thingy to you OWN connection String What Suites your MS SQL SERVER 2005 Instance ..  )
    My personal String is:
    Data Source=Asif\SQL2K5;integrated security=SSPI;initial catalog=aspnet;
    KOOOOOOOOOL !!!

    3. One more thing ... Giving Access  to  ASPNET User to use  MS SQL SERVER 2005 DBs
    Sometimes you have setup your ASPNET System Account for using MS SQL SERVER 2005 Databases,,  in that case it will NOT get Connected and Right on the Connection.Open(); it will Throw Exception .... In this case (i mean if you dont have permisions to Connect ASPNET application to Connect to MS SQL SERVER 2005 ...)
    Run MS SQL SERVER 2005 Management Studio from
    Start > All Programs > Microsoft SQL SERVER 2005 > SQL Server Management Studio
    Connect to the Database Instance .... using your Windows Authentiaction simply
    then Right Below the DatabasesNode press the *SECURITY* Node... there you will Right Click the Node: Logins > New Login (from Right Click Context Menu) > Press Search Button > Advanced > Find Now > Choose the ASPNET Account .. and Press OK > OK and Finally OK ....it will Give your ASPNET account to access the Databases while you will be using IIS Browsing ETC ETC ....

    now go to your Visual Studio 2005 and run the *Website Configuration Tool* .. from
    Website (Main Menu) > ASP.Net Configuration >


    Huff .. !!!!   HERE WE ARE  .................

    Now You people will be Able to Surely Connect to your DB

    Hope it will help you ...

    I'm Going to write the NEXT Tutorial to Use that ASPNET DB for programming Rolebased Security by using that ASP.Net configuration tool and then Customize it .. 

    You people will find this Tutorial on http://codeproject.com .. later.. on other day i will post the Code Project Link here  .... there i will also paste the Print screen images...

    BYE Have a Good connectivity to Databases Smile



    • Asif Ashraf
    • Microsoft Certified Application Developer for .Net
    • Microsoft Certified Professional
    • Asif.log@gamil.com || hotmail.com
    • Asif@Colossys.com
    • Project Manager, Sr. Developer Colossys LLC Reg.
  • Thursday, June 28, 2007 12:18 PM
     
     

    Thanks, Arno. This really solved my problem.

     

    Thanks and Regards,

    - Anand.

  • Saturday, August 04, 2007 6:41 PM
     
     

     

    I  am following example from a Microsoft Press book titled Windows Communication Foundations Step by Step by John Sharpe an in Chapter 5 there is an exercise that , Page 125, where you create and AP.Net Website and use the web configuration management tool in the browser,

    “Now that you have deployed, configured, and tested the WCF service by using IIS, you can use

    the ASP.NET Administration Tool to define the users and roles that will be permitted to access

    the service. To keep things simple, you will create roles (WarehouseStaff and StockControllers)

    and users (Fred and Bert) that mimic those you created by using Windows in Chapter 4.

    Define users and roles for the WCF service

    1. In Visual Studio 2005, in the Website menu, click ASP.NET Configuration.

    The ASP.NET Web Site Administration Tool starts. This is actually another Web application

    that runs using the ASP.NET Development Server (a stand-alone Web server

    installed with Visual Studio 2005, and separate from IIS):”

     

    Well I get the same error when I CLICK on the Security tab I get an error stating:

    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 tried to turn on the role features from the command line from that I found on a microsoft webpage:
    http://msdn2.microsoft.com/en-us/library/x28wfk74(VS.80).aspx

    I ran the aspnet_regsql.exe from the command line with the appropriate parameters and it worked:

    C:\Windows\system32>aspnet_regsql.exe -E -S propmancom\propmancon -A r

    Start adding the following features:
    RoleManager

    .........

    Finished.

    http://msdn2.microsoft.com/en-us/library/x28wfk74(VS.80).aspx

    I ran the aspnet_regsql.exe from the command line with the appropriate parameters and it worked:

    C:\Windows\system32>aspnet_regsql.exe -E -S propmancom\propmancon -A r

    Start adding the following features:
    RoleManager

    .........

    Finished.

     but I  got the same error when clicking the security tab as before. I even set permission on the C:\Program Files\Microsoft SQL Server directory so the user I am login in as has full permission as an administrator but this failed also.

    I am running Windows Vista Extreme Edition,Professional Edition Visual Studio 2005 and a fully legal purchased of SQL Server 2005. If anyone is using the same book, or has access to it and can tell me how to solve this problem feel free to email me stevensrf1@inbox.com

    Thanks

    Steve

    Stevensrf1@inbox.com

  • Friday, January 04, 2008 2:56 PM
     
     

    It worked....

     

    Thank a lot.

     

  • Friday, February 01, 2008 12:36 AM
     
     
     ObieOne wrote:

    In the web.config file I changed / added the following:

     

    <connectionStrings>

    <remove name="LocalSqlServer" />

    <add name="LocalSqlServer" connectionString="Integrated Security=SSPI;Data Source=YOURMACHINENAME ;Initial Catalog=aspnetdb;" providerName="System.Data.SqlClient" />

    </connectionStrings>

     

     

    Thanks Arno.

     

    This is exactly the problem I was facing on VS2005 / Vista / SQLExpress 2005.

     

    I have no idea how you figured this out, but my test app is now working.

     

    Cheers

       Scott

  • Friday, February 01, 2008 8:38 AM
     
     

     

    Jesus. this thread has been here two years ago.

    glad it helped you guys.

     

    I'm back after two years!

  • Thursday, February 21, 2008 10:52 PM
     
     

    that one did interest me....In IIS7 I changed connection strings at the IIS Server level with the database - aspnetdb...and that solved my problem.

     

    hi all,

    this one might interest you

    start>run>control>administrative tools>internet information services

    in the IIS rightclick default website>click on properties> click on asp.net

    in the asp.net click version2> then click edit global configuration.

    take a look at the connection string property for LOCALSQLSERVEr

    its pointing to (.)\SQLEXPRESS

    regards

    joey

     

  • Saturday, March 08, 2008 7:05 AM
     
     
    I am having a problem getting the concept to work in my head... I have my SQL Server 2005 on a DIFFERENT machine...
    The ASPNET account is not usable in this case..  How do I configure Membership Security  in this case  ?
  • Saturday, April 19, 2008 8:14 AM
     
     

     jonpfl wrote:
    All,

    When I create a new project and try to use the WSAT security tab, 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 am using VS2005 beta2 with a local copy of SQL Server Express.

    I am new to all of this so a little help would be great

    Thx
    jonpfl

     

    Yes, exactly i too got the same problem..Please provide the solution.Its urgent..

  • Saturday, April 19, 2008 8:14 AM
     
     Proposed Answer

     jonpfl wrote:
    All,

    When I create a new project and try to use the WSAT security tab, 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 am using VS2005 beta2 with a local copy of SQL Server Express.

    I am new to all of this so a little help would be great

    Thx
    jonpfl

     

    Yes, exactly i too got the same problem..Please provide the solution.Its urgent..

    • Proposed As Answer by VinhPham Friday, June 05, 2009 7:59 AM
    •  
  • Friday, June 05, 2009 8:02 AM
     
     
    You can change Connection Strings in IIS in Control Panel\Administrative Tools
    my email: vinhpham.it@gmail.com


  • Friday, June 05, 2009 8:07 AM
     
     
    You can change Connection Strings in IIS in Control Panel\Administrative Tools
    my email: vinhpham.it@gmail.com


  • Saturday, August 08, 2009 11:27 AM
     
      Has Code
    Hi All The reason this happens is web.config inherits from machine.config.LocalSqlServer connection is already configured in your machine.config file. Here is the solution. after
    <connectionStrings>
     just write
    <clear/>



     its that simple. Now webconfig will clear the connectionstring that inherited from machine config and add your new connection string. it should look like this:

      <connectionStrings>
        <clear/>
        <add name="LocalSqlServer" connectionString="Data Source=.;Initial Catalog=aspnetdb;Integrated Security=SSPI;"/>
      </connectionStrings>



    Ahmet TOK
  • Monday, September 14, 2009 5:23 AM
     
     
    Thanks so much! I have been looking for a while, and this was the only thing that worked.  Thanks a ton
  • Wednesday, November 11, 2009 7:42 AM
     
     

    Arno, YOU ROCK!!!!

    I have spent 6 hours trying to figure this out and your answer worked immediately!!!!

    One would think that the WPI would fix this or least MS would post a heads-up to save wasted hours.

    JC

  • Tuesday, January 26, 2010 4:13 PM
     
     

    can u explain how to enable the role manager?


    windows&&
  • Tuesday, July 20, 2010 9:57 PM
     
     

    I have the problem too; however, the answers cannot solve my problem.

     

    First, it's not working when I added an connectionString in my web.config (I got another error message on the web page.)

    Second, I use IIS 7.0. Therefore, I cannot find the properties selection after I rightclick default website, but when I clicked the .Net role or the .Net user items in the middle of the setting page. I got an error message pup up. It showed "Generating user instances in sql server is disabled....)

    I've looked for the answer of the last problem and I got this link http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/88def9dd-5bf7-4156-b416-6db1c6752d48/

    I've tried and solve the last problem, and I also solve the problem too (Unable to connect to SQL Server database).

     

    hope it's a useful information that will help someone who still cannot solve this problem.

    Thank all of the contributors.

     

    Linch

  • Friday, October 29, 2010 9:45 AM
     
     Proposed Answer

    Arno

    You are a Guru! Thanks a million times. :)

  • Wednesday, December 08, 2010 10:22 PM
     
     

    hello

    i just went over your conversation

    i have the same problem , i am loosing my last hair

    i don't know how i can handle that my email addres is

    davar_shad@hotmail.com

    please help me out , i have visual studio 2008 and i am trying to connect to sqlserver 2005

    via ASP.Net Web Site Administration Tool , the error is:

    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: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

  • Thursday, December 09, 2010 2:38 AM
     
     

    hello

    please help me out , i have visual studio 2008 and i am trying to connect to sqlserver 2005

    via ASP.Net Web Site Administration Tool , the error is:

    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: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

    Hi,

    Sorry, I really have no idea about your situation, but I do some search on google...

    Hope these links will have a little help for you.

    http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/

    http://serverfault.com/questions/58579/cannot-connect-to-sql-server

    http://community.discountasp.net/archive/index.php/t-8320.html

    Linch


    ben lin
  • Thursday, March 31, 2011 2:31 PM
     
     

    Salut ,

     

    how to connect visual studio 2010 with SQLSERVER 2008 not express .

    more detail 

     

  • Monday, October 03, 2011 11:37 PM
     
     

    im having the same problem..

    anyone..?

  • Thursday, November 24, 2011 11:36 PM
     
     

    Thank you. After adding that piece of code, now I get a new error message "
    The following message may help in diagnosing the problem: Cannot open database "aspnetdb" requested by the login. The login failed. Login failed for user 'MYCOMPUTERNAME\MY USER ACCOUNT WHICH I ALSO SPECIFIED TO USE IN SQL'.

    What else can I do here? I hate the fact that it has been talking of SQL Express while I use SQL Enterprise. Please help.

  • Thursday, November 24, 2011 11:44 PM
     
     

    Hi! I am new to ASP.NET, so please bear with me. I get the same problem. When you talk about going to ISS, I wonder if I must use ISS. I have not stored/uploaded my website to ISS yet, I am just designing it, page by page and preview in a browser (Ctl+F5) in Visual Studio 2010 and so test the page in the browser, and there is where I get the error message. Is anything wrong with not using ISS? What can I do? Please help.

    Thank in Advance.

  • Tuesday, August 21, 2012 4:30 AM
     
     

    Whoa bro thanks alot!!! took me a whole day to figure out how to get this to work. Was all because of the freaking connection string. I removed the local server and then added the connection string back again like you had added. Many thanks to you for helping me solve the issue. This was a major accomplishment to get this bloody issue to work.