Re: SQL Server problem
- From: "Marina" <someone@xxxxxxxxxx>
- Date: Tue, 24 May 2005 09:18:16 -0400
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.
"Torsjon" <torshavn@xxxxxxxxx> wrote in message
news:1116926071.778033.34010@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>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?
>
.
- References:
- SQL Server problem
- From: Torsjon
- SQL Server problem
- Prev by Date: Re: ADO.NET - Excel and Column header..
- Next by Date: Group By
- Previous by thread: SQL Server problem
- Next by thread: Tricky Ado.net Addition
- Index(es):
Relevant Pages
|