SQL Server problem

T

Torsjon

I have created a simple web application using ASP.NET, which queries an
SQL-Server database, but every time the application is run, I get the
following error: (truncated for brevity)

Exception Details: System.Data.SqlClient.SqlException: SQL Server does
not
exist or access denied.

Relevant code is here:

string strConnection = "Data Source=testdb;Initial
Catalog=testdatabase;User Id=testuser;Password=testpassword;";
dbConn = new SqlConnection(strConnection);
dbConn.Open();
strSQL = "SELECT Title, ISBN, Publisher " +
"FROM BOOK " +
"ORDER BY Title";

dbCmd = new SqlCommand(strSQL, dbConn);
dbReader = dbCmd.ExecuteReader();

dgQuick.DataSource = dbReader;
dgQuick.DataBind();

My setup is as follows:

IIS 5 webserver running on Windows XP
Database server is Microsoft SQL-Server 2000, running on Windows Server
2003 Enterprise

(These two servers are in seperate Windows domains)

The really odd thing is that I can connect just fine using the same
connection information in Query Analyzer running on the same machine as
the web server.

What I'm thinking is that most likely the ASP.NET worker process
running on the web server does not have the proper access rights for
accessing the database server. I'm not especially knowledgeable about
the security model on Windows 2003 server, so this is just a guess.

Anyone got any suggestions?
 
M

Marina

This isn't an ASP.NET permissions issue, since you are not using integrated
security.

Try putting the datasource as "domain\testdb" for the machine name.
 

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

Top