Results 1 to 2 of 2

Thread: Problem with connectionstring

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    3

    Question Problem with connectionstring

    Hi,

    i´m new in .net and i have a problem with a connectionstring for a SQL Server 2000 database.

    In WebMatrix (for those who know it) it´s possible to generate a datapage with this connectionstring:

    Dim myConnectionString As String = "server= (local);database=pubs;trusted_connection=true"

    When i run the application inside WebMatrix everything is ok, I see my database.

    If i try to run the apllication in visual studio.net or by http://localhost/........ .aspx with this same connection string i get the following error

    System.Data.SqlClient.SqlException: Login failed for user 'RUICOMPU\ASPNET'

    RUICOMPU is the name of my computer.

    What modifications should i do in the connectionstring ??

    I think the problem is in server=(local) . Sometimes i see localhost instead of local. What is the diference ? In SQL Server 2000 i have (LOCAL)(Windows NT)

    Please help me, Thanks
    Last edited by trg_550; Oct 28th, 2004 at 02:05 PM.

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    The issue here is that your connection string specifies integrated authentication (which is good); ASP.Net is impersonating the RUICOMPU\ASPNET user (default user for web applications, btw).

    The short of it is that you need to add the RUICOMPU\ASPNET user as a user to SQL Server and give it appropriate permissions to your database(s) via Enterprise Damager & you're problem will happily disappear.

Posting Permissions

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



Click Here to Expand Forum to Full Width