Tuesday, March 20, 2012

Cannot open database on local server

Server Error in '/QuickStartv20/aspnet/samples/data' Application.


This is the error i am getting when i was going through the asp .net quickstart tutorials to learn using the databases. I have installed sql server 2005 on windows xp along with asp .net framework 2.0 on my system. i am student, so i dont how to configure a database. i went through a lot of tutorials of microsoft and macromedia but was unable to get the information requirred to create and access the database on asp .net and sql servers. they assumed that all know how to configure the database to work with the dynamic pages.

|||||||||||||||||||||||||

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database "pubs" requested by the login. The login failed.
Login failed for user 'MLHPR\ASPNET'.

|||||||||||||||||||||||||

this was another line from the error page.i need help in configuring the sql (and asp .net) server to use the database. i have been getting a lot these error pages when i tried to open (local)database related pages on my system.

i am very much thankful to any help given in this regard.

It looks like the user in the machine/domain MLHPR called ASPNET is the one trying to access the database. I'll bet there's no login for that user in the system.

The first thing to do is try and see if you can connect at all - on the server where SQL Server lives, type this at a Windows command prompt:

osql -E -d pubs -Q "SELECT 'I got in.'"

If you see the words "I got in" on the screen, then SQL Server is up and running. If not, either SQL isn't installed or there is no database called "pubs" on it.

You can read more about SQL Server security here: http://www.informit.com/guides/content.asp?g=sqlserver&seqNum=35&rl=1

Note: If this answers your question, make sure you mark it "answered" so that others can find it!

Buck Woody
http://www.buckwoody.com

|||

thanks you very much for your response

ya pubs was not configured to be used with the sql server. i searched for the file and found the file in some folder of sql but not on the sql server. then i worked around in the microsoft .net folder to find the installation file for configuring the databases 'pubs' and 'northwind' on the sql server.

when i installed the file it worked fine.another reason was that i forgot to add the server to the expection list of the firewall.

the installation file for databases was in the 'microsoft .net/sdk/v2.0/samples/setup/' folder for using with quickstart samples of the asp .net.

No comments:

Post a Comment