Results 1 to 6 of 6

Thread: Using SQLCacheDependency in Ms-SQL 2005

  1. #1
    Join Date
    Oct 2008
    Posts
    22

    Using SQLCacheDependency in Ms-SQL 2005

    Hi All,
    i am trying to enable sqlcachedependecy on the database 'testdb' which i am using in the project.
    When using the command on command line
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspn et_regsql.exe -S servername -U username -P password -d testdb -ed
    i got the below error
    "Enabling the database for SQL cache dependency.

    .An error has happened. Details of the exception:
    Login failed for user 'username'.

    Unable to connect to the SQL database for cache dependency registration."

    However the same details i am using in the connection string of web.config file of my project and it's working well. I am able to connect to the database using the connectionstring.
    But when i try to enable cachedependency i got the above error.
    By the way i am using SQLEXPRESS edition.
    Is any permission lacking??

    Regards
    Prashant

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Is sql instance name correct?

  3. #3
    Join Date
    Oct 2008
    Posts
    22
    yes, sql instance name is correct.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    User used has proper permission in testdb? If so, doesn't sound sql issue then.

  5. #5
    Join Date
    Oct 2008
    Posts
    22
    Hi rmiao
    yes, because i am using the same connection string in the web.config file of the project it's working well, but when i use the same credentials to enable sqlcachedependency on the database it's saying "Login failed for user 'username'."
    Don't know if it is permission issue .I am using SQLExpress Edition.
    Last edited by prashant12se; 01-07-2009 at 12:37 AM.

  6. #6
    Join Date
    Oct 2008
    Posts
    22
    Hi All,
    I solved the issue. I used the command "aspnet_regsql.exe -S COMPUTERNAME\SQLEXPRESS -E -d MyDatabase -ed"
    to enable the sqlcaching on the database and it worked.

    Actually there are different commands depending on the type of Authentication you use for SQL-Server.
    The one i posted in my first message is for SQL Server Authentication and the above command is for Windows Authentication to enable caching on the database.

    Thanks to all for your post.
    Last edited by prashant12se; 01-07-2009 at 06:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •