Hi all,
I'm experiencing a problem using ASP.NET web services to access a
different server with SQL Server 2000 database.
And I get the error of the following
Exception Details: System.Data.SqlClient.SqlException: SQL Server does
not exist or access denied.
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
WebApplication1.WebForm1.butSearch_Click(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\WebApplication1\search.aspx.vb: 64
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()
here are the details:
It works fine
=============
- connected by SQL Server enterprise manager
- A simple windows form application that has the same code works just
fine
- same source code if web server and database server are in same
machine
Server 1: (database)
====================
server name: database_server
Database: SQL Server 2000
table: ABC
user_id: abc_user
password: abc_password
Server 2: (web server)
======================
web server: Window XP + IIS
IIS Setting: Directory Security -Anonymous access and authentication
control -turn off "Anonymous access"
IIS Setting: Directory Security -Anonymous access and authentication
control -checked "Integrated Windows authentication"
web.config setting: <authentication mode="Windows" />
connection string used in System.Data.SqlClient:
================================================
- connectionStr = "User ID=abc_user;Password=abc_password;Initial
Catalog=ABC;Data Source=database_server;Network Library =dbmssocn"
- not using any impersonation coz i just want to use 'abc_user' to make
the connection to sql server, can I?
- this connectionStr work fine if connecting by vb.net application
I'd found many many posts with similar problem, but still out of luck.
i believe the problem is due to the connection but i had already
specified the user id and password in my connectionStr, so what still
wrong?
Your help is greatly appreciated.
Regards,
Sammy Loo