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

M

Matthew Louden

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
 
S

steve

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'
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top