SQL connection error while running demo

7 posts, 0 answers
  1. Jay
    Jay avatar
    7 posts
    Member since:
    Oct 2009

    Posted 02 Nov 2009 Link to this post

    I am getting error as below:
    It was working fine last week until I reinstalled. Any suggestion?

     

    Server Error in '/RadControls_AspNetAjax' Application.

    Cannot open user default database. Login failed.
    Login failed for user '***************'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
    Login failed for user '***********'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): Cannot open user default database. Login failed.
    Login failed for user '*********'.]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849015
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2394
       System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
       System.Data.SqlClient.SqlConnection.Open() +122
       System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +47
    
    
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 02 Nov 2009 Link to this post

    Does this occur with every demo that uses a sample SQL connection? Also, were there any issues when you re-installed and have you tried to re-install again? You might need to see if the user you are currently logged in as has the security rights to access the installed demo's database files.
  3. Jay
    Jay avatar
    7 posts
    Member since:
    Oct 2009

    Posted 04 Nov 2009 Link to this post

    Somehow all files were installed as read-only under Telerik folder. Must be Win-7 problem. Never happened before in same environment, I am using win-7 over 3 months. Changed folder security as well to give write access to data.

    Thanks
  4. Ziji
    Ziji avatar
    4 posts
    Member since:
    May 2011

    Posted 17 Sep 2011 Link to this post

    I use only SQL SQLExpress 2008 and no SQL Server or SQL Server Dev installed on my Windows 7 laptop.
    The account running SQLExpress on my laptop is Network Service.
    I had trouble running AJAX Demo as I kept getting above errors for months. I tried many tricks posted here but no luck.
    Finally, I tried to grant Full Conctrol to Network Service on 'C:\PROGRAM FILES\TELERIK\RADCONTROLS FOR ASP.NET AJAX Q1 2011\LIVE DEMOS' folder (NOT the App_Data under it !!!) and the Demo works without any database connection error.
    The important thing is the folder needs the Full Conctrol permission is LIVE DEMOS, NOT App_Data under it !!!
  5. Jorge
    Jorge avatar
    1 posts
    Member since:
    Oct 2011

    Posted 07 Oct 2011 Link to this post

    I'm having the same trouble. You changed the permissions for which user?

    Greetings!
  6. Bilal M
    Bilal M avatar
    2 posts
    Member since:
    Oct 2013

    Posted 25 Nov 2013 Link to this post

    Just change your instance name from webconfig e.g.

    <add name="NorthwindConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

    TO

    <add name="NorthwindConnectionString" connectionString="Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

    AND as well

    <add name="OlympicsConnectionString" connectionString="Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|OlympicsReadOnly.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

        <add name="NorthwindConnectionString35" connectionString="Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
       
    <add name="TelerikConnectionString35" connectionString="Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|Telerik.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
       
     <add name="NorthwindEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|\Northwind.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
       
    <add name="TelerikEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|\Telerik.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
       
    <add name="QSFRatingsConnectionString" connectionString="Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|QSFRatings.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
       
    <add name="SelfReferencingDbConnectionString" connectionString="Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|TelerikSelfReferencingDb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
       
    <add name="NorthwindEntities35" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=YOURINSTANCENAME;AttachDbFilename=|DataDirectory|\Northwind.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
       
     <add name="TelerikEntities35" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.YOURINSTANCENAME;AttachDbFilename=|DataDirectory|\Telerik.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>

    *Don't forget to save your original WebConfig file separately
    Thanks To SIR RAFIQ. 
  7. Bilal M
    Bilal M avatar
    2 posts
    Member since:
    Oct 2013

    Posted 28 Mar 2014 in reply to Bilal M Link to this post

    Remove User Instance = True; in case of SQL sa password is activated
Back to Top