Page view counter

Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

Last post 11-06-2008 6:10 AM by kyle@live-it.com. 16 replies.

Sort Posts:

  • Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-22-2008, 4:49 PM

     Hi,

      if my post is not belong here, please point me the right place.

    I using Vista Business , microsfot visual studio 2005 and ms sql server (developer edition).

    I tryied to set up Role for my web site using ASP.net web site Administration Tool. But i have seen error and cant sort it out. 

    I followed below step.

     

    In visual studio 2006,

    clicked Web site meu, ASP.NET configuration..

    Clicked security.. , and then it said below line.

    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. 

     And then i followed the step clicking choose Data Source Button.

    It come up like this belwo

     Use this page to configure how Web site management data such as membership is stored. You can use a single provider for all the management data for your site or you can specify a different provider for each feature.

    Your application is currently configured to use the provider:
    AspNetSqlProvider

    Select a single provider for all site management data
    Select a different provider for each feature (advanced)

     And then i clicked first line above which is a single provider for all site management data..

    This page came up....below...

     

    Use this page to select a provider for storing site management data.
     
    Provider
    AspNetSqlProvider Test







    I clicked the above Test link and error came up below..

     

     

    Provider Management
    Could not establish a connection to the database.
    If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.

     Please help me to sort it out.

     

    Thanks, 



    T













     

    Joe
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-22-2008, 11:34 PM
    • Loading...
    • gavinharriss
    • Joined on 03-05-2005, 8:07 AM
    • Posts 289
    • Points 873

    Have you made sure the connection string for your database is correct in the web.config file?

    I also think you have to run a utility or some scripts against your SQL Server database to create the required tables and objects for the AspNetSqlProvider. Have you done this?

    Gavin Harriss
    Portfolio: www.gavinharriss.com
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-23-2008, 1:50 AM
    • Loading...
    • chenthil_it
    • Joined on 07-08-2008, 9:01 AM
    • Pune
    • Posts 290
    • Points 1,490

    Before try using the administration tool you need to run an script that will register aspnet db with your database.

    aspnet_regsql.exe -E -S localhost -A mr
    
    http://msdn.microsoft.com/en-us/library/ms229862.aspx
    Check the following link for more information.
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-23-2008, 5:11 AM
    • Loading...
    • mydreams
    • Joined on 08-28-2008, 9:18 AM
    • Posts 83
    • Points 194

    You may have not connected database successfully. Sometime the problem is caused by the configuration  of the database.

  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-23-2008, 7:47 AM

    HI,

    I have configured connection string for my data base in the web.config file. It worked probably. I can upload data on my web page.

    I do not know wat kind of script to run a utility to create the required tables and objects for the AspNetSqlProvider.

    I followed below to run a script tha will register aspnet db with my database.

    C:/Windows>Microsoft.NET\FrameWrok\v2.0.50727> aspnet_regsql.exe

    configuration wizard came up and asked me and followed the step which the wizad has provided.
    I chose Configuration sQLServer for application services
    next
    Chose SQL Server authentication, Database Default
    next
    and next

    Error

    Setup failed.

    Exception:
    Unable to connect to SQL Server database.

    ----------------------------------------
    Details of failure
    ----------------------------------------

    System.Web.HttpException: Unable to connect to SQL Server database. ---> System.Data.SqlClient.SqlException: Login failed for user 'cute_Developer\kyaw'.
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
       --- End of inner exception stack trace ---
       at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
       at System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install)
       at System.Web.Management.SqlServices.Install(String database, SqlFeatures features, String connectionString)
       at System.Web.Management.ConfirmPanel.Execute()


    Please Help me

    Joe
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-23-2008, 7:52 AM

    I used 

    Window authentication for SQL server log in... 

    Joe
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-23-2008, 3:36 PM

    I used SQL server Express Before. ASP.NET web site admin tool was working probably with SQL Express.

    Now I using SQL Developer Version. Please tell me is there anything different between these sql version. is it happen because of SQL Developer Edition??

    Pleease help me out. 

    Joe
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-23-2008, 4:51 PM
    • Loading...
    • gavinharriss
    • Joined on 03-05-2005, 8:07 AM
    • Posts 289
    • Points 873
    Have you given user cute_Developer\kyaw db_owner permissions on the database so the account can be used to create the required tables, views and stored procedures?
    Gavin Harriss
    Portfolio: www.gavinharriss.com
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-23-2008, 6:00 PM

    I already created table and stored procedure in my database(cute_Developer\kyaw). And I can upload data on my web site from database. The problem is

    when i create role manager using ASP.net web site tool, error came up like I said on my 1st post.

     

    Thank for your email, Please Help me out.

    Other wise i have to uninstall SQL developer edition and reinstall Express Edition.

    Thanks 

    Joe
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-23-2008, 11:40 PM
    Answer
    • Loading...
    • Mar7in
    • Joined on 08-05-2008, 4:20 PM
    • AB, Canada
    • Posts 68
    • Points 376

    <roleManager ......>
          <providers>
            <clear/>

     <add .......


    <membership ......>
          <providers>
            <clear/>

     <add .......

     Be sure to "clear" first ... there are default settings in machine.config level...

    Please Mark the post as "Answer" if it solves your problem.

    http://www.dotnetsharp.com/
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-24-2008, 5:04 PM
    • Loading...
    • gavinharriss
    • Joined on 03-05-2005, 8:07 AM
    • Posts 289
    • Points 873

    innocent_Developer:

    I already created table and stored procedure in my database(cute_Developer\kyaw). And I can upload data on my web site from database. The problem is

    when i create role manager using ASP.net web site tool, error came up like I said on my 1st post.

     

    So you're saying you have already got all the aspnet_Users, and other aspnet_* tables, views and stored procedures present in your database that aspnet_regsql.exe would have created for you?

    Gavin Harriss
    Portfolio: www.gavinharriss.com
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-25-2008, 4:53 PM

    Hi,

    I'm saying I have created tables and stored procedures in SQL and have given owner permission for tables. But i havenet create aspnet_USers and aspnet_tables,

    i tried .. aspnet_regsql.exe and u can see errors massage which i have posted already above.

     

    Joe
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-25-2008, 7:19 PM
    • Loading...
    • gavinharriss
    • Joined on 03-05-2005, 8:07 AM
    • Posts 289
    • Points 873

    In that case...

    When you ran aspnet_regsql.exe it asked for which database to be run against and which account to use to connect to that database I guess?

    Did you select the database you use for your application?

    Did the account you supply credentials for been granted db_owner permissions on that database in SQL Server? (having db_owner permission on the database allows the tables, stored procedures and views to be created using the account)

    Gavin Harriss
    Portfolio: www.gavinharriss.com
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-26-2008, 4:52 PM

     That is a good questing for me. When i tried,

    In the server text box : cute_Developer and

    Database : <Default>

    I tried to choose my database... but message box came up. it said

    Connect failed

    Failed to query a list of database names from the sql server. Login failed for user 'Cute_Developer\kyaw'

     

    What should  i do? any advice.. Please 

    Joe
  • Re: Error!! ==Unable to connect to sQL Server database using ASP.net Web site Admin Tool

    09-26-2008, 6:13 PM
    • Loading...
    • murtaza_t
    • Joined on 09-12-2008, 12:22 AM
    • Earth
    • Posts 51
    • Points 222

    1.  Make sure that the user kyaw has db_owner permissions over the database you are tryging to connect.

    2. Try resetting the password of the user from compmgmt.msc >> Local Users and groups >> Users.

    Moosa.
    ---------
    eUKhost.com
    Your Search for Webhosting Ends here..
    ASP .NET - MSSQL Hosting
    Free ASP .NET - MSSQL Solutions
Page 1 of 2 (17 items) 1 2 Next >