Can't open my SQL database - why?
Hi all,
I’m running through a simple SQL server web application and I get an error message that reads:
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'COCLAP-9\ASPNET'.
Here is my connection string:
Dim objConnection As New SqlClient.SqlConnection _
("server=COCLAP-9\VSDOTNET;database=LOTR;trusted_connection=true")
As you can see, the connection string reads COCLAP-9\VSDOTNET (and not 'COCLAP-9\ASPNET' as in the error message - Hhmm :confused: ). When I created the database I left the ‘Use Windows NT Integrated Security’ option button checked.
My server name is COCLAP-9 and the database name is LOTR. Which are correct in the connection string :)
when I run the application it shows the Default.aspx page as expected but as soon as I try to Open to the database, withthis line objConnection.Open() I get the error message.
I can’t see anything wrong here, can you?
Why do I need to login on a simple database application?
Any ideas?
Thanks for your time :)
What Password and User name should I use?
Something more to add:
I think I need to removed the trusted_connection and add a password and user name. But I'm confused now. I need a user name and password to log on to my PC at work. Surely this can't have anything to do with it, can it? :confused:
I created a small database myself on the PC (I'm trying to learn SQL server by giving myself a project) through Server Explorer. Then I want to add to it through ASP.NET. Simple enough really, but this has held me up for a while now. I really want to understand what's going on and it seems I need further help. :eek:
Anyway, what should I do about a user ID and Password? Do I need to congfigure them somewhere? Or do I make them up?
Thanks for you time