ASP.NET run-time error: ASP.NET ADO User Registered Failure

Discussion in 'ASP .Net' started by Matthew Louden, Oct 11, 2003.

  1. I guess this is more likely the user problem, but don't know how to fix. For
    regular server-side programs without using data access or ADO, there is no
    run-time error. I really have no idea why it doesn't work.

    any ideas? Thanks!

    Exception Details: System.Data.SqlClient.SqlException: User
    'MYComputerName\ASPNET' Registered Failure.

    Source Error:


    Line 35: Dim cs As String = "Data Source=MyComputerName\MySQL; _
    Integrated Security=SSPI;Persist Security Info=False;Initial
    Catalog=autoattendant;Trusted_Connection=yes"
    Line 36: Dim cn As New SqlConnection(cs)
    Line 37: cn.Open()
    Line 38: Response.Write("string = " & cn.ConnectionString)
    Line 39: End Sub
     
    Matthew Louden, Oct 11, 2003
    #1
    1. Advertising

  2. Matthew Louden

    steve Guest

    you need to add ASPNET as a user of the sql server database instance you are
    trying to access. if you're using msde, you can execute the following to add
    the user.

    hth,

    steve



    if not exists (select * from master.dbo.syslogins where loginname =
    n'[[INSTANCE_NAME]]\ASPNET')
    exec sp_grantlogin n'[[INSTANCE_NAME]]\ASPNET'
    exec sp_defaultdb n'[[INSTANCE_NAME]]\ASPNET', n'master'
    exec sp_defaultlanguage n'[[INSTANCE_NAME]]\ASPNET', n'us_english'

    if not exists (select * from master.dbo.syslogins where loginname =
    n'[[INSTANCE_NAME]]\ASPNET'] and uid < 16382)
    exec sp_granddbaccess n'[[INSTANCE_NAME]]\ASPNET',
    n'[[INSTANCE_NAME]]\ASPNET'

    exec sp_addrolemember n'db_datareader', n'[[INSTANCE_NAME]]\ASPNET'
    exec sp_addrolemember n'db_datawriter', n'[[INSTANCE_NAME]]\ASPNET'
    exec sp_addrolemember n'db_owner', n'[[INSTANCE_NAME]]\ASPNET'




    "Matthew Louden" <> wrote in message
    news:%...
    > I guess this is more likely the user problem, but don't know how to fix.

    For
    > regular server-side programs without using data access or ADO, there is no
    > run-time error. I really have no idea why it doesn't work.
    >
    > any ideas? Thanks!
    >
    > Exception Details: System.Data.SqlClient.SqlException: User
    > 'MYComputerName\ASPNET' Registered Failure.
    >
    > Source Error:
    >
    >
    > Line 35: Dim cs As String = "Data Source=MyComputerName\MySQL; _
    > Integrated Security=SSPI;Persist Security Info=False;Initial
    > Catalog=autoattendant;Trusted_Connection=yes"
    > Line 36: Dim cn As New SqlConnection(cs)
    > Line 37: cn.Open()
    > Line 38: Response.Write("string = " & cn.ConnectionString)
    > Line 39: End Sub
    >
    >
     
    steve, Oct 11, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nita
    Replies:
    1
    Views:
    905
    Saravana
    Nov 20, 2004
  2. ronaldlee

    Transfer ADO Code to ADO.NET

    ronaldlee, Dec 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    493
    Kevin Spencer
    Dec 17, 2004
  3. Replies:
    0
    Views:
    1,345
  4. Pierre Yves
    Replies:
    2
    Views:
    526
    Pierre Yves
    Jan 10, 2008
  5. Navin
    Replies:
    1
    Views:
    767
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page