Click to See Complete Forum and Search --> : Login failed for user Error in ASP.net


Asim
10-06-2003, 04:11 AM
Hi

I am using ASP.net for first time and while Iam connecting to my sql server(using sql connection).

upto here code is ok
conn =New SqlConnection("server=asim-b300;database=pubs;Trusted_connection=Yes")


but after this line I have an error

Mycommand.fill(Ds,"Authors")
MyDatagrid.Datasource=ds.tables("Authors").defaultview
mydatagrid.Databind()

i.e
Login failed for user 'asim-b300\IUSR_asim-b300

So then I search the web it says its is an impersonate thing so I enabled it but the error is still there

pls help me
thanks

rdoekes
10-06-2003, 09:42 AM
Have you allowed this trusted user access to the database? I believe that's what the messages tells you.
You also need to configure you web.config <authentication mode="Windows"/>, since this username is the default anonymous web user in Windows.

The syntax for this user is [Domain Name]\IUSR_[Machine Name]

PeOfEo
10-06-2003, 01:58 PM
No, that authentification mode does not need to be windows infact that would cause errors if it is not running off of your server, it needs to be what the host specifies, check what it says inside your defaul web.config if one was provided for you. Who is your host? I can furnish some of my source codes if need be, I am also using sql server.